diff --git a/change_logs/.DS_Store b/change_logs/.DS_Store deleted file mode 100644 index 7845ccc2..00000000 Binary files a/change_logs/.DS_Store and /dev/null differ diff --git a/change_logs/1-0_to_1-0-1.txt b/change_logs/1-0_to_1-0-1.txt deleted file mode 100644 index 72876df7..00000000 --- a/change_logs/1-0_to_1-0-1.txt +++ /dev/null @@ -1,28 +0,0 @@ -Upgrading from 1.0.0 to 1.0.1 ------------------------------ - - -Files to update ----------------- - -index.php - -sources/Boards.php -sources/Forums.php -sources/post.php - -sources/lib/post_reply_post.php -sources/lib/post_q_reply_post.php -sources/search.php - -sources/Admin/ad_member.php - - -Bugs Fixed ----------- - -Various Posting bugs fixed -Tighter permission checking when posting -ICQ number not being saved when editing a profile via the ACP -Incorrect error displayed when attempting to access a forum you don't have permission for -Shortened topic titles in board view display showing partial HTML entities (credit Chrisken) diff --git a/install_guide/data/help.html b/install_guide/data/help.html index ffa241f1..6ab35c3f 100644 --- a/install_guide/data/help.html +++ b/install_guide/data/help.html @@ -134,10 +134,10 @@ If you have a problem outside the ones solved in this guide, then don't panic!
We have a large team of trained support professionals that will be able to provide a solution to your problems.
- Your first stop would be to open a new support ticket. The FREE ticket system is available from the Invision Board Member Center. When starting a new ticket, please + Your first stop would be to open a new support ticket. The FREE ticket system is available from the Invision Board web site. When starting a new ticket, please be as thorough as you can in your error reporting, it will save our team time in responding to you. We pride ourselves on quality, professional support and aim to answer your request as promptly as possible.
- You can also post a problem on our "Support and Community Boards". We have a large active community who have experience in maintaining their Invision Board who may be able to give you a prompt reply - our support professionals also moderate these forums and + You can also post a problem on our "Support and Community Forums". We have a large active community who have experience in maintaining their Invision Board who may be able to give you a prompt reply - our support professionals also moderate these forums and will read your posts. We do recommend that you make use of the search facility on the board to avoid posting problems that have already been posted - there is also a good chance that it's already been reported, discussed and solved.
@@ -145,14 +145,14 @@
Priority support entitles you to the following benefits: +
  • We can install and upgrade the software for you if desired.
    -For more information on our priority support service, please visit our Invision Board Member Center. +For more information on our priority support service, please visit our advanced services page.

    -If you wish to contact us, please visit our Contact Page which includes a handy email form, mailing address and telephone number. +If you wish to contact us for non-technical issues, please visit our Contact Page which includes a handy email form, mailing address and telephone number. @@ -160,4 +160,4 @@ If you wish to contact us, please visit our
    Using your FTP client, create the following directories "archive_in", "archive_out", "html", "lang", "Skin", "sources", "ssi_templates", "style_images", - "style_sheets", "style_templates" and "uploads" (TIP: If your FTP client supports "Drag n' Drop" which most modern clients do, you can save yourself some time and effort by + and "uploads" (TIP: If your FTP client supports "Drag n' Drop" which most modern clients do, you can save yourself some time and effort by simply selecting all the files from the "unzipped" zip archive and drag them into your FTP client window, this will then copy all the files, creating the directories as it goes. If you choose to do this, you can safely ignore most of the following instruction, just remember to CHMOD as outlined in the stucture and CHMOD guide).

    @@ -45,7 +45,7 @@ files and folders, upload them all - preserving the structure you have in your zip file (for example, upload the entire contents of the "html" folder on your computer to the "html" directory on the server).

    Once you have finished uploading into the directories, upload the rest of the files "admin.php", "conf_global.php", "conf_mime_types.php", "index.php", - "phpinfo.php", "sm_install.php", "ssi.php" to the same place as you created the directories earlier (into "forums" for our example). + "install_templates.txt", "sm_install.php", "ssi.php" to the same place as you created the directories earlier (into "forums" for our example).
    CHMOD "conf_global.php" to 0666 (if you get permission denied errors later on, you can CHMOD this to 0777).

    @@ -101,7 +101,7 @@ The Invision Board administration control panel is a very sophisticated tool. This is where you can create new categories and forums for your board, as well - as set bad word filters, edit emoticons, change the board colours and so on. We recommend you browse the documentation at
    Invision Board before getting attempting some of the more complex operations. + as set bad word filters, edit emoticons, change the board colours and so on. We recommend you browse the documentation at Invision Board before getting attempting some of the more complex operations.

    Lets get stuck in!
    @@ -116,7 +116,7 @@
    If your website was about computers, you could enter "PC Software" as the category name. Submit the form by clicking the button at the bottom of the page.
    Now we have a category to "group" the forums, lets create a forum or two.

    Click on "New Forum" found in the same expandable menu. Choose "Normal Forum" from the drop down box and proceed. -
    There are many options here, which are outside the scope of this guide, for more information see the documentation at Invision Board. We can +
    There are many options here, which are outside the scope of this guide, for more information see the documentation at Invision Board. We can create a new forum without knowing what all the options do. Using our example, you might want a forum dedicated to "Games" - if so, enter "Games" as the forum title, and a suitable description for the new forum. When you have done this scroll down and submit the form by clicking the button at the bottom of the page.

    @@ -217,6 +217,14 @@ - - - + + + PHP file + install_templates.txt + - + - + - + - folder @@ -226,14 +234,6 @@ - X - - PHP file - phpinfo.php - - - - - - - - - folder Skin @@ -282,22 +282,6 @@ - X - - folder - style_sheets - 0755 - 0755 - - - X - - - folder - style_templates - 0755 - 0755 - - - X - folder uploads @@ -317,4 +301,4 @@ - + - - - - Invision Install Guide: Welcome - - - - - - - - - - - - - -
    Welcome to Invision Board!
    -
    Welcome to Invision Board, a fast, efficient, scalable community solution written in PHP and using mySQL for database storage. -

    - This guide will help you through the installation process and get you on your way to setting up your own Invision Board. -
    - Installation is very straight forward, only taking about 15 minutes from uploading the files to logging into your administration center. -
    -
    - You will need an FTP (File Transfer Protocol) client, if you do not have one you can download Smart FTP for Windows or - InterArchy for Macintosh. At the time of writing both websites have freeware or free trial versions available for download. -
    You do not need an indepth knowledge of PHP programming to install Invision Board, but a working knowledge of FTP functions is a plus. -
    -
    This guide assumes that you have successfully downloaded the latest release from Invision Board and have the Zip file "unzipped" and ready to go. -
    The instructions will term the zip file you downloaded as "the zip archive", the directories created by the unzipping process as "the local folders" and the directories on your website as - "website directories" - this is to prevent confusion. -

    - If you don't know your FTP from your PHP and your CHMOD from your CHOWN, then you might wish to consider our Installation Service. For a low cost, once only fee - - one of our installation professionals will install and set up your board for you. For more information, please visit our advanced services page. -
    - -
    - - - - - - - - - -
    Requirements
    The exact requirements will depend on many factors, your estimated board traffic being one. -

    Server Requirements -
    - You must have a webserver that has PHP 4.0.3 (or better) and mySQL 3.22 (or better) installed. If you are unsure whether your server has these - programs installed, please check with your web host now. If you are capable, you can always download PHP - and download mySQL and install it yourself. -
    Invision Board works best on an Apache server, and is Apache 1 and Apache 2 savvy. -

    - General Requirements -
    - You do not need a new mySQL database as Invision Board supports table prefixes to prevent tables being overwritten. -
    You will also need the mySQL username and mySQL password for a mySQL user that has permission to "CREATE", "DROP" and "ALTER" tables. -
    You will need about 2mb of free web space and roughly 3mb of mySQL database space to allow installation and a moderately sized community. -
    If you are unsure on any of these points, please ask your webhost before proceeding. -

    - >> Enough chit chat, lets get installing! -
    - -

    - - - - - -
    - - - - - + + + + + Invision Install Guide: Welcome + + + + + + + + + + + + + +
    Welcome to Invision Board!
    +
    Welcome to Invision Board, a fast, efficient, scalable community solution written in PHP and using mySQL for database storage. +

    + This guide will help you through the installation process and get you on your way to setting up your own Invision Board. +
    + Installation is very straight forward, only taking about 15 minutes from uploading the files to logging into your administration center. +
    +
    + You will need an FTP (File Transfer Protocol) client, if you do not have one you can download Smart FTP for Windows or + InterArchy for Macintosh. At the time of writing both websites have freeware or free trial versions available for download. +
    You do not need an indepth knowledge of PHP programming to install Invision Board, but a working knowledge of FTP functions is a plus. +
    +
    This guide assumes that you have successfully downloaded the latest release from Invision Board and have the Zip file "unzipped" and ready to go. +
    The instructions will term the zip file you downloaded as "the zip archive", the directories created by the unzipping process as "the local folders" and the directories on your website as + "website directories" - this is to prevent confusion. +

    + If you don't know your FTP from your PHP and your CHMOD from your CHOWN, then you might wish to consider our Installation Service. For a low cost, once only fee + - one of our installation professionals will install and set up your board for you. For more information, please visit our advanced services page. +
    + +
    + + + + + + + + + +
    Requirements
    The exact requirements will depend on many factors, your estimated board traffic being one. +

    Server Requirements +
    + You must have a webserver that has PHP 4.0.3 (or better) and mySQL 3.22 (or better) installed. If you are unsure whether your server has these + programs installed, please check with your web host now. If you are capable, you can always download PHP + and download mySQL and install it yourself. If your web host does not support PHP or mySQL, consider hosting your entire web site or forums with IPS Hosting services. +
    Invision Board works best on an Apache server, and is Apache 1 and Apache 2 savvy. +

    + General Requirements +
    + You do not need a new mySQL database as Invision Board supports table prefixes to prevent tables being overwritten. +
    You will also need the mySQL username and mySQL password for a mySQL user that has permission to "CREATE", "DROP" and "ALTER" tables. +
    You will need about 2mb of free web space and roughly 3mb of mySQL database space to allow installation and a moderately sized community. +
    If you are unsure on any of these points, please ask your webhost before proceeding. +

    + >> Enough chit chat, lets get installing! +
    + +

    + + + + + +
    + + + + +\r
    During registration, the adminstrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering.\r
    In some cases, the administrator will need to approve your regsitration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your private messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', 'How to register and the added benefits of being a registered member.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    This board will also allow you to remove the long session id\'s found in the URL\'s. You can do this by entering your control panel (click the link at the top of the board) and entering the \'Board Settings\' section. It is recommended that you enable this feature because you may experience problems if your internet connection shares a proxy and you share a link with another user. If in doubt, choose to hide the session id.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (3, 'Recovering lost or forgotten passwords', 'Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', 'How to reset your password if you\'ve forgotton it.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (4, 'Your Control Panel', 'Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose. All of this information is optional and can be omitted.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your timezone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and hide the long session ID in links (see the \'Cookies\' help file for more infomation on this).\r
    \r
    Skins and Languages\r
    \r
    If available, you can choose a skin style and language choice. This affects how the board is displayed so you may wish to preview the skin before submitting the form.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.\r
    \r
    View Subsciptions\r
    \r
    This is where you manage your topic subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.', 'Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (5, 'Email Notification of new messages', 'This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    To do this, simply click on the \'Track This Topic\' link found at the top and bottom of any topic. When you click this link, the topic will be added to your subscriptions that are managed from your control panel.\r
    \r
    Please note that to avoid multiple emails being sent to your email address, you will only get notified once per day of new replies.', 'How to get emailed when a new reply is added to a topic.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (6, 'Your Personal Messenger', 'Your personal messenger acts much like an email account in that you can send and receive messages and store messages in folders.\r
    \r
    Send a new PM\r
    \r
    This will allow you to send a message to another member. If you have names in your contact list, you can choose a name from it - or you may choose to enter a name in the relevant form field. This will be automatically filled in if you clicked a \'PM\' button on the board (from the memberlist or a post).\r
    If the administrator allows, you may use BB Code and HTML in your private message. If you choose to check the \'Add a copy of this message to you sent items folder\' box, a copy of the message will be saved for you for later reference. If you check the \'Get notified when this message is read\' box, you will receive a PM informing you when the message was read for your records.\r
    \r
    Contact List\r
    \r
    You may add in users names in this section, or edit any saved entries. You can also use this as a ban list, denying the named member the ability to message you.\r
    Names entered in this section will appear in the drop down list when sending a new PM, allowing you to quickly choose the members name when sending a message.\r
    \r
    Edit Folders\r
    \r
    You may rename, add or remove folders to store messages is, allowing you to organise your messages to your preference. You cannot remove \'Sent Items\' or \'Inbox\'.\r
    \r
    Go to Inbox\r
    \r
    Your inbox is where all new messages are sent to. Clicking on the message title will show you the message in a similar format to the board topic view. You can also delete or move messages from your inbox.\r
    \r
    Archive Messages\r
    \r
    If your messenger folders are full and you are unable to receive new messages, you can archive them off. This compiles the messages into a single HTML page or Microsoft © Excel Format. This page is then emailed to your registered email address for your convenience.\r
    \r
    ', 'How to send personal messages, edit your messenger folders and archive stored messages.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (7, 'Contacting the moderating team', 'If you need to contact a moderator or simply wish to view the complete administration team, you can click the link \'The moderating team\' found at the top of the main board page (the first page you see when visiting the board).\r
    \r
    This list will show you administrators (those who have administration control panel access), global moderators (those who can moderate in all forums) and the moderators of the individual forums.\r
    \r
    If you wish to contact someone about your member account, then contact an administrator - if you wish to contact someone about a post or topic, contact either a global moderator or the forum moderator.', 'Where to find a list of the board moderators and administrators.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (8, 'Viewing members profile information', 'You can view a members profile at any time by clicking on their name when it is underlined (as a link) or by clicking on their name in a post within a topic.\r
    \r
    This will show you their profile page which contains their contact information (if they have entered some) and their \'active stats\'.', 'How to view members contact information.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (9, 'Viewing todays active topics', 'You can view which new topics have new replies today by clicking on the \'Todays Active Topics\' link found on the main board page (the first page you see when visiting the board).\r
    \r
    You can set your own date critera, choosing to view all topics with new replies during several date choices.', 'How to view all the topics which have a new reply today'); INSERT INTO ibf_faq (id, title, text, description) VALUES (10, 'Searching Topics and Posts', 'The search feature is designed to allow you to quickly find topics and posts that contain the keywords you enter.\r
    \r
    The \'Simple Search\' option from the drop down box allows you to enter a single keyword or phrase to search by - the advanced option allows you to join keywords with \'AND\', \'OR\' to fine tune the search. Using this option will make the search slightly slower.\r
    \r
    The bottom section of the form allows you to further fine tune the search. You can choose a category to search in, or a forum - or choose all forums to search in.\r
    \r
    If you enter a name into the \'Search by member name\' section, all posts started or replied in by this member are returned.', 'How to use the search feature.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (11, 'Logging in and out', 'If you have chosen not to remember your log in details in cookies, or you are accessing the board on another computer, you will need to log into the board to access your member profile and post with your registered name.\r
    \r
    When you log in, you have the choice to save cookies that will log you in automatically when you return. Do not use this option on a shared computer for security.\r
    \r
    You can also choose to hide - this will keep your name from appearing in the active users list.\r
    \r
    Logging out is simply a matter of clicking on the \'Log Out\' link that is displayed when you are logged in. If you find that you are not logged out, you may need to manually remove your cookies. See the \'Cookies\' help file for more information.', 'How to log in and out from the board and how to remain anonymous and not be shown on the active users list.'); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (4, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 'Admin', 0, 1, 1, 1, 1, '', 5000, 1, 1, '', ''); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 'Guests', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NULL, NULL, NULL, 1, 1, 1, 0, 0, 'Members', 0, 1, 0, 0, 0, NULL, NULL, 1, 0, NULL, NULL); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Validating', 0, 1, 0, 0, 0, NULL, 0, 0, 0, NULL, NULL); INSERT INTO ibf_images (imid, setname, A_LOCKED_B, A_MOVED_B, A_POLL, A_POLLONLY_B, A_POST, A_REPLY, A_STAR, B_HOT, B_HOT_NN, B_LOCKED, B_MOVED, B_NEW, B_NORM, B_PIN, B_POLL, B_POLL_NN, C_LOCKED, C_OFF, C_OFF_CAT, C_OFF_RES, C_ON, C_ON_CAT, C_ON_RES, F_ACTIVE, F_NAV_SEP, F_NAV, F_STATS, GO_LAST_ON, GO_LAST_OFF, M_ADDMEM, M_DELETE, M_READ, M_REPLY, M_UNREAD, P_AOL, P_DELETE, P_EDIT, P_EMAIL, P_ICQ, P_MSG, P_PROFILE, P_QUOTE, P_WEBSITE, CAT_IMG, B_HOT_DOT, B_NEW_DOT, B_HOT_NN_DOT, B_NORM_DOT, B_POLL_DOT, B_POLL_NN_DOT, NEW_POST) VALUES (1, 'Invision Board Image Set', '\'\'', '\'\'', '\'\'', '[ Poll Only ]', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', ' ->', '\'\'', '\'\'', '', '', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '[ Profile ]', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'\'', '\'Goto'); INSERT INTO ibf_members (id, name, mgroup, password, email, joined, ip_address, avatar, avatar_size, posts, photo, aim_name, icq_number, location, signature, website, yahoo, title, allow_admin_mails, time_offset, interests, hide_email, email_pm, email_full, skin, warn_level, language, msnname, last_post, allow_post, view_sigs, view_img, view_avs, view_pop, bday_day, bday_month, bday_year, new_msg, msg_from_id, msg_msg_id, msg_total, vdirs, show_popup, validate_key, prev_group, new_pass, misc, last_visit, last_activity) VALUES (0, 'Guest', 2, '', 'guest@ibforums.com', 0, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0); INSERT INTO ibf_skins (uid, sname, sid, set_id, tmpl_id, img_id, css_id, tbl_width, tbl_border, hidden, default_set) VALUES (1, 'Invision Board', 0, 1, 1, 1, 1, '95%', '#999999', 0, 1); INSERT INTO ibf_stats (TOTAL_REPLIES, TOTAL_TOPICS, LAST_MEM_NAME, LAST_MEM_ID, MOST_DATE, MOST_COUNT, MEM_COUNT) VALUES (0, 0, NULL, '0', '0', '0', '0' ); INSERT INTO ibf_templates (tmid, template, name) VALUES (1, ' <% TITLE %> <% GENERATOR %> <% CSS %> <% JAVASCRIPT %> <% BOARD HEADER %><% NAVIGATION %><% BOARD %><% STATS %><% COPYRIGHT %>', 'Invision Board Standard'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (1, 0, 'Newbie', '1'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (2, 10, 'Member', '2'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (4, 30, 'Advanced Member', '3'); INSERT INTO ibf_tmpl_names (skid, skname, author, email, url) VALUES (1, 'Invision Board Templates', 'Invision Board', 'skins@invisionboard.com', 'http://www.invisionboard.com'); INSERT INTO ibf_languages (`lid`, `ldir`, `lname`, `lauthor`, `lemail`) VALUES ('', 'en', 'English', 'Invision Board', 'languages@invisionboard.com'); \ No newline at end of file diff --git a/schematic/required2.sql b/schematic/required2.sql new file mode 100644 index 00000000..73a15746 --- /dev/null +++ b/schematic/required2.sql @@ -0,0 +1 @@ +INSERT INTO ibf_categories (id, position, state, name, description, image, url) VALUES (-1, NULL, NULL, '-', NULL, NULL, NULL); INSERT INTO ibf_categories (id, position, state, name, description, image, url) VALUES (1, 1, '1', 'A Test Category', '', '', ''); INSERT INTO ibf_css (cssid, css_name, css_text, css_comments) VALUES (1, 'Invision Style Sheet', 'form { display:inline }\r\nTABLE, TR, TD { font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color: #000000 }\r\na:link, a:visited, a:active { text-decoration: underline; color: #000000 }\r\na:hover { color: #465584 }\r\n.hlight { background-color: #DFE6EF }\r\n.dlight { background-color: #EEF2F7 }\r\n.mainbg { background-color: #FFFFFF }\r\n.mainfoot { background-color: #BCD0ED }\r\n.forum1 { background-color: #DFE6EF }\r\n.forum2 { background-color: #E4EAF2 }\r\n.post1 { background-color: #F5F9FD }\r\n.post2 { background-color: #EEF2F7 }\r\n.posthead { background-color: #E4EAF2 }\r\n\r\n.postbak { background-color: #D2D2D0 }\r\n.title { background-color: #C4DCF7 }\r\n.row1 { background-color: #EEF2F7 }\r\n.row2 { background-color: #F5F9FD }\r\n.postsep { background-color: #C7D2E0; height: 1px }\r\n\r\n.signature { font-size: 7.5pt; color: #333399 }\r\n.postdetails { font-size: 7.5pt }\r\n.postcolor, #postcolor { font-size: 9pt; line-height: 160% }\r\n.membertitle { font-size: 10px; line-height: 150%; color: #000000 }\r\n.normalname { font-size: 12px; font-weight: bold; color: #000033; padding-bottom: 2px }\r\n.normalname a:link, .normalname a:visited, .normalname a:active { text-decoration: underline; color: #000033; padding-bottom: 2px }\r\n.unreg { font-size: 11px; font-weight: bold; color: #990000 }\r\n.highlight { color: #FF0000 }\r\n.highlight a:link, .highlight a:visited, .highlight a:active { text-decoration: underline; color: #FF0000 }\r\n.highlight a:hover { text-decoration: underline }\r\n.desc { font-size: 8.0pt; color: #434951 }\r\n.copyright { font-family: Verdana, Tahoma, Arial; font-size: 7.5pt; line-height: 12px }\r\n.category { font-weight: bold; line-height: 150%; color: #4C77B6; background-color: #C2CFDF }\r\n.category a:link, #category a:visited, #category a:active { text-decoration: none; color: #4C77B6 }\r\n.postfoot {\r\n\r\n font-weight:bold;\r\n\r\n color:#3A4F6C;\r\n\r\n height: 24px;\r\n\r\n background-color: #D1DCEB;\r\n\r\n}\r\n.titlefoot { font-weight: bold; color: #3A4F6C; height: 24px; background-color: #BCD0ED }\r\n.titlemedium {\r\n\r\n font-weight:bold;\r\n color:#3A4F6C;\r\n\r\n height: 30px;\r\n\r\n background-color: #9FBCE3;\r\n \r\n background-image: url(style_images/<#IMG_DIR#>/tile_sub.gif);\r\n\r\n}\r\n.titlemedium a:link, .titlefoot a:link, .titlemedium a:visited, .titlefoot a:visited, .titlemedium a:active, .titlefoot a:active { text-decoration: underline; color: #3A4F6C }\r\n.titlemedium a:hover, .subtitle a:hover, .titlefoot a:hover { text-decoration: underline; color: #000000 }\r\n.maintitle {\r\n\r\n color:#FFFFFF;\r\n\r\n font-size: 9.5pt;\r\n \r\n height: 26px;\r\n \r\n background-image: url(style_images/<#IMG_DIR#>/tile_back.gif);\r\n\r\n}\r\n.edit { font-size: 9px }\r\n.fancyborder { border: 1px dashed #999999 }\r\n.solidborder { border: 1px solid #999999 }\r\n.maintitle a:link, .maintitle a:visited, .maintitle a:active { text-decoration: none; color: #FFFFFF }\r\n.maintitle a:hover { text-decoration: underline }\r\n.nav { font-weight: bold; color: #000000; font-size: 8.5pt }\r\n.pagetitle { color: #4C77B6; font-size: 18px; font-weight: bold; letter-spacing: -1px; line-height: 120% }\r\n.useroptions { background-color: #598CC3; height: 25px; font-weight: bold; color: #FFFFFF }\r\n.useroptions a:link, .useroptions a:visited,.useroptions a:active { text-decoration: none; color: #FFFFFF }\r\n.bottomborder { border-bottom: 1px dashed #D2D2D0 }\r\n.linkthru { color: #000000; font-size:8.5pt }\r\n.linkthru a:link, .linkthru a:active { text-decoration: underline; color: #000000 }\r\n.linkthru a:visited { text-decoration: underline; color: #000000 }\r\n.linkthru a:hover { text-decoration: underline; color: #465584 }\r\n#QUOTE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }\r\n#CODE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }\r\n.codebuttons { font-size: 8.5pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.forminput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.textinput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.input { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n', NULL); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (1, ':mellow:', 'mellow.gif', 0); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (2, ':huh:', 'huh.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (3, '^_^', 'happy.gif', 0); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (4, ':o', 'ohmy.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (5, ';)', 'wink.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (6, ':P', 'tongue.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (7, ':D', 'biggrin.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (8, ':lol:', 'laugh.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (9, 'B)', 'cool.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (10, ':rolleyes:', 'rolleyes.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (11, '-_-', 'sleep.gif', 0); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (12, '<_<', 'dry.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (13, ':)', 'smile.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (14, ':wub:', 'wub.gif', 0); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (15, ':angry:', 'mad.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (16, ':(', 'sad.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (17, ':unsure:', 'unsure.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (18, ':wacko:', 'wacko.gif', 0); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (19, ':blink:', 'blink.gif', 1); INSERT INTO ibf_emoticons (id, typed, image, clickable) VALUES (20, ':ph34r:', 'ph34r.gif', 1); INSERT INTO ibf_faq (id, title, text, description) VALUES (1, 'Registration benefits', 'To be able to use all the features on this board, the administrator will probably require that you register for a member account. Registration is free and only takes a moment to complete.\r
    \r
    During registration, the adminstrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering.\r
    In some cases, the administrator will need to approve your regsitration before you can use your member account fully. If this is the case you will be notified during registration.\r
    \r
    Once you have registered and logged in, you will have access to your private messenger and your control panel.\r
    \r
    For more information on these items, please see the relevant sections in this documentation.', 'How to register and the added benefits of being a registered member.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r
    \r
    This board will also allow you to remove the long session id\'s found in the URL\'s. You can do this by entering your control panel (click the link at the top of the board) and entering the \'Board Settings\' section. It is recommended that you enable this feature because you may experience problems if your internet connection shares a proxy and you share a link with another user. If in doubt, choose to hide the session id.\r
    \r
    Clearing Cookies\r
    \r
    You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r
    \r
    Removing Cookies in Internet Explorer for Windows\r
    \r
    \r
    \r
    Removing Cookies in Internet Explorer for Macintosh\r
    \r
    \r
    \r
    Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (3, 'Recovering lost or forgotten passwords', 'Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r
    This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r
    \r
    To do this, click on the Lost Password link found on the log in page.\r
    \r
    Further instruction is available from there.', 'How to reset your password if you\'ve forgotton it.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (4, 'Your Control Panel', 'Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r
    \r
    Edit Profile Info\r
    \r
    This section allows you to add or edit your contact information and enter some personal information if you choose. All of this information is optional and can be omitted.\r
    \r
    Edit Signature\r
    \r
    A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r
    \r
    Edit Avatar Settings\r
    \r
    An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r
    \r
    Email Settings\r
    \r
    Hide my email address allows you to deny the ability for other users to send you an email from the board.\r
    Send me updates sent by the board administrator will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r
    Include a copy of the post when emailing me from a subscribed topic, this allows you to have the new post included in any reply to topic notifications.\r
    \r
    Board Settings\r
    \r
    From this section, you can set your timezone, choose to not see users signatures, avatars and posted images.\r
    You can choose to get a pop up window informing you when you have a new message and hide the long session ID in links (see the \'Cookies\' help file for more infomation on this).\r
    \r
    Skins and Languages\r
    \r
    If available, you can choose a skin style and language choice. This affects how the board is displayed so you may wish to preview the skin before submitting the form.\r
    \r
    Change Email Address\r
    \r
    At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r
    \r
    Change Password\r
    \r
    You may change your password from this section. Please note that you will need to know your current password before you can change your password.\r
    \r
    View Subsciptions\r
    \r
    This is where you manage your topic subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.', 'Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (5, 'Email Notification of new messages', 'This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r
    \r
    To do this, simply click on the \'Track This Topic\' link found at the top and bottom of any topic. When you click this link, the topic will be added to your subscriptions that are managed from your control panel.\r
    \r
    Please note that to avoid multiple emails being sent to your email address, you will only get notified once per day of new replies.', 'How to get emailed when a new reply is added to a topic.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (6, 'Your Personal Messenger', 'Your personal messenger acts much like an email account in that you can send and receive messages and store messages in folders.\r
    \r
    Send a new PM\r
    \r
    This will allow you to send a message to another member. If you have names in your contact list, you can choose a name from it - or you may choose to enter a name in the relevant form field. This will be automatically filled in if you clicked a \'PM\' button on the board (from the memberlist or a post).\r
    If the administrator allows, you may use BB Code and HTML in your private message. If you choose to check the \'Add a copy of this message to you sent items folder\' box, a copy of the message will be saved for you for later reference. If you check the \'Get notified when this message is read\' box, you will receive a PM informing you when the message was read for your records.\r
    \r
    Contact List\r
    \r
    You may add in users names in this section, or edit any saved entries. You can also use this as a ban list, denying the named member the ability to message you.\r
    Names entered in this section will appear in the drop down list when sending a new PM, allowing you to quickly choose the members name when sending a message.\r
    \r
    Edit Folders\r
    \r
    You may rename, add or remove folders to store messages is, allowing you to organise your messages to your preference. You cannot remove \'Sent Items\' or \'Inbox\'.\r
    \r
    Go to Inbox\r
    \r
    Your inbox is where all new messages are sent to. Clicking on the message title will show you the message in a similar format to the board topic view. You can also delete or move messages from your inbox.\r
    \r
    Archive Messages\r
    \r
    If your messenger folders are full and you are unable to receive new messages, you can archive them off. This compiles the messages into a single HTML page or Microsoft © Excel Format. This page is then emailed to your registered email address for your convenience.\r
    \r
    ', 'How to send personal messages, edit your messenger folders and archive stored messages.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (7, 'Contacting the moderating team', 'If you need to contact a moderator or simply wish to view the complete administration team, you can click the link \'The moderating team\' found at the top of the main board page (the first page you see when visiting the board).\r
    \r
    This list will show you administrators (those who have administration control panel access), global moderators (those who can moderate in all forums) and the moderators of the individual forums.\r
    \r
    If you wish to contact someone about your member account, then contact an administrator - if you wish to contact someone about a post or topic, contact either a global moderator or the forum moderator.', 'Where to find a list of the board moderators and administrators.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (8, 'Viewing members profile information', 'You can view a members profile at any time by clicking on their name when it is underlined (as a link) or by clicking on their name in a post within a topic.\r
    \r
    This will show you their profile page which contains their contact information (if they have entered some) and their \'active stats\'.', 'How to view members contact information.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (9, 'Viewing todays active topics', 'You can view which new topics have new replies today by clicking on the \'Todays Active Topics\' link found on the main board page (the first page you see when visiting the board).\r
    \r
    You can set your own date critera, choosing to view all topics with new replies during several date choices.', 'How to view all the topics which have a new reply today'); INSERT INTO ibf_faq (id, title, text, description) VALUES (10, 'Searching Topics and Posts', 'The search feature is designed to allow you to quickly find topics and posts that contain the keywords you enter.\r
    \r
    The \'Simple Search\' option from the drop down box allows you to enter a single keyword or phrase to search by - the advanced option allows you to join keywords with \'AND\', \'OR\' to fine tune the search. Using this option will make the search slightly slower.\r
    \r
    The bottom section of the form allows you to further fine tune the search. You can choose a category to search in, or a forum - or choose all forums to search in.\r
    \r
    If you enter a name into the \'Search by member name\' section, all posts started or replied in by this member are returned.', 'How to use the search feature.'); INSERT INTO ibf_faq (id, title, text, description) VALUES (11, 'Logging in and out', 'If you have chosen not to remember your log in details in cookies, or you are accessing the board on another computer, you will need to log into the board to access your member profile and post with your registered name.\r
    \r
    When you log in, you have the choice to save cookies that will log you in automatically when you return. Do not use this option on a shared computer for security.\r
    \r
    You can also choose to hide - this will keep your name from appearing in the active users list.\r
    \r
    Logging out is simply a matter of clicking on the \'Log Out\' link that is displayed when you are logged in. If you find that you are not logged out, you may need to manually remove your cookies. See the \'Cookies\' help file for more information.', 'How to log in and out from the board and how to remain anonymous and not be shown on the active users list.'); INSERT INTO ibf_forums (id, topics, posts, last_post, last_poster_id, last_poster_name, name, description, position, use_ibc, use_html, status, start_perms, reply_perms, read_perms, password, category, last_title, last_id, sort_key, sort_order, prune, show_rules, upload_perms, preview_posts, allow_poll, allow_pollbump, inc_postcount, skin_id, parent_id, subwrap, sub_can_post) VALUES (1, 1, 1, 0, 1, 'Invision Board Team', 'A Test Forum', 'A test forum that may be removed at any time', 1, 1, 0, '1', '*', '*', '*', '', 1, 'Welcome', 1, 'last_post', 'Z-A', 30, 0, '', 0, 0, 0, 1, NULL, -1, 0, 1); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix, g_max_messages, g_max_mass_pm, g_search_flood, g_edit_cutoff, g_promotion, g_hide_from_list) VALUES (4, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 'Admin', 0, 1, 1, 1, 1, '', 50000, 1, 1, '', '', 50, 6, 0, 5, '-1&-1', 0); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix, g_max_messages, g_max_mass_pm, g_search_flood, g_edit_cutoff, g_promotion, g_hide_from_list) VALUES (2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 'Guests', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, 50, 0, 20, 0, '-1&-1', 0); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix, g_max_messages, g_max_mass_pm, g_search_flood, g_edit_cutoff, g_promotion, g_hide_from_list) VALUES (3, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 'Members', 0, 1, 0, 0, 0, '', 0, 1, 0, '', '', 50, 0, 20, 0, '-1&-1', 0); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix, g_max_messages, g_max_mass_pm, g_search_flood, g_edit_cutoff, g_promotion, g_hide_from_list) VALUES (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Validating', 0, 1, 0, 0, 0, NULL, 0, 0, 0, NULL, NULL, 50, 0, 20, 0, '-1&-1', 0); INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix, g_max_messages, g_max_mass_pm, g_search_flood, g_edit_cutoff, g_promotion, g_hide_from_list) VALUES (5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Banned', 0, 0, 0, 0, 0, NULL, NULL, 0, 0, NULL, NULL, 50, 0, 20, 0, '-1&-1', 1); INSERT INTO ibf_languages (lid, ldir, lname, lauthor, lemail) VALUES (1, 'en', 'English', 'Invision Board', 'languages@invisionboard.com'); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (1, 'A_LOCKED_B', '/t_closed.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (2, 'A_MOVED_B', '/t_moved.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (4, 'A_POLLONLY_B', '/t_closed.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (5, 'A_POST', '/t_new.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (6, 'A_REPLY', '/t_reply.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (7, 'A_STAR', '/pip.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (8, 'B_HOT', '/f_hot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (9, 'B_HOT_NN', '/f_hot_no.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (10, 'B_LOCKED', '/f_closed.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (11, 'B_MOVED', '/f_moved.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (12, 'B_NEW', '/f_norm.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (13, 'B_NORM', '/f_norm_no.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (14, 'B_PIN', '/f_pinned.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (15, 'B_POLL', '/f_poll.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (16, 'B_POLL_NN', '/f_poll_no.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (17, 'C_LOCKED', '/bf_readonly.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (18, 'C_OFF', '/bf_nonew.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (19, 'C_OFF_CAT', '/bc_nonew.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (20, 'C_OFF_RES', '/br_nonew.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (21, 'C_ON', '/bf_new.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (22, 'C_ON_CAT', '/bc_new.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (23, 'C_ON_RES', '/br_new.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (24, 'F_ACTIVE', '/user.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (25, 'F_NAV_SEP', ' ->', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (26, 'F_NAV', '/nav.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (27, 'F_STATS', '/stats.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (28, 'GO_LAST_ON', '', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (29, 'GO_LAST_OFF', '', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (30, 'M_ADDMEM', '/msg_l_addmem.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (31, 'M_DELETE', '/msg_l_delete.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (32, 'M_READ', '/f_norm_no.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (33, 'M_REPLY', '/msg_l_reply.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (34, 'M_UNREAD', '/f_norm.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (35, 'P_AOL', '/p_aim.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (36, 'P_DELETE', '/p_delete.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (37, 'P_EDIT', '/p_edit.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (38, 'P_EMAIL', '/p_email.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (39, 'P_ICQ', '/p_icq.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (40, 'P_MSG', '/p_pm.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (41, 'P_PROFILE', '[ Profile ]', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (42, 'P_QUOTE', '/p_quote.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (43, 'P_WEBSITE', '/p_www.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (44, 'CAT_IMG', '/nav_m.gif\' border=\'0\' alt=\'\' width=\'8\' height=\'8\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (45, 'B_HOT_DOT', '/f_hot_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (46, 'B_NEW_DOT', '/f_norm_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (47, 'B_HOT_NN_DOT', '/f_hot_no_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (48, 'B_NORM_DOT', '/f_norm_no_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (49, 'B_POLL_DOT', '/f_poll_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (50, 'B_POLL_NN_DOT', '/f_poll_no_dot.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (51, 'NEW_POST', '/newpost.gif\' border=\'0\' alt=\'Goto last unread\' title=\'Goto last unread\' hspace=2>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (52, 'tbl_width', '95%', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (53, 'tbl_border', '#345487', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (55, 'P_YIM', '/p_yim.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro (macro_id, macro_value, macro_replace, can_remove, macro_set) VALUES (56, 'P_MSN', '/p_msn.gif\' border=\'0\' alt=\'\'>', 0, 1); INSERT INTO ibf_macro_name (set_id, set_name) VALUES (1, 'IBF Default Macro Set'); INSERT INTO ibf_members (id, name, mgroup, password, email, joined, ip_address, avatar, avatar_size, posts, aim_name, icq_number, location, signature, website, yahoo, title, allow_admin_mails, time_offset, interests, hide_email, email_pm, email_full, skin, warn_level, language, msnname, last_post, allow_post, view_sigs, view_img, view_avs, view_pop, bday_day, bday_month, bday_year, new_msg, msg_from_id, msg_msg_id, msg_total, vdirs, show_popup, validate_key, prev_group, new_pass, misc, last_visit, last_activity, dst_in_use, view_prefs, coppa_user, mod_posts, auto_track) VALUES (0, 'Guest', 2, '', 'guest@ibforums.com', 0, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, '0', 0, 0, 0, '-1&-1', 0, 0, 0); INSERT INTO ibf_posts (append_edit, edit_time, pid, author_id, author_name, use_sig, use_emo, ip_address, post_date, icon_id, post, queued, topic_id, forum_id, attach_id, attach_hits, attach_type, attach_file, post_title, new_topic, edit_name) VALUES (0, NULL, 1, 1, 'Invision Board Team', '1', '1', '127.0.0.1', 0, 0, 'Welcome to your new Invision Board!
    This is simply a test message confirming that the installation was successful.
    You can remove this message, topic, forum or even category at any time.', 0, 1, 1, '', 0, '', '', NULL, 1, NULL); INSERT INTO ibf_skins (uid, sname, sid, set_id, tmpl_id, macro_id, css_id, img_dir, tbl_width, tbl_border, hidden, default_set) VALUES (1, 'Invision Board', 0, 1, 1, 1, 1, '1', '95%', '#999999', 0, 1); INSERT INTO ibf_stats (TOTAL_REPLIES, TOTAL_TOPICS, LAST_MEM_NAME, LAST_MEM_ID, MOST_DATE, MOST_COUNT, MEM_COUNT) VALUES (0, 1, '', '1', 0, 1, 1); INSERT INTO ibf_templates (tmid, template, name) VALUES (1, ' <% TITLE %> <% GENERATOR %> <% CSS %> <% JAVASCRIPT %> <% BOARD HEADER %><% NAVIGATION %><% BOARD %><% STATS %><% COPYRIGHT %>', 'Invision Board Standard'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (1, 0, 'Newbie', '1'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (2, 10, 'Member', '2'); INSERT INTO ibf_titles (id, posts, title, pips) VALUES (4, 30, 'Advanced Member', '3'); INSERT INTO ibf_tmpl_names (skid, skname, author, email, url) VALUES (1, 'Invision Board Template Set', 'Invision Board', 'skins@invisionboard.com', 'http://www.invisionboard.com'); INSERT INTO ibf_topics (tid, title, description, state, posts, starter_id, start_date, last_poster_id, last_post, icon_id, starter_name, last_poster_name, poll_state, last_vote, views, forum_id, approved, author_mode, pinned, moved_to, rating, total_votes) VALUES (1, 'Welcome', '', 'open', 0, '0', 0, '0', 0, 0, 'Invision Board Team', 'Invision Board Team', '0', 0, 0, 1, 1, 0, 0, NULL, NULL, 0); \ No newline at end of file diff --git a/schematic/tables.sql b/schematic/tables.sql index 140ee7cf..453cac0d 100644 --- a/schematic/tables.sql +++ b/schematic/tables.sql @@ -1 +1 @@ -CREATE TABLE ibf_admin_sessions ( ID varchar(32) NOT NULL default '', IP_ADDRESS varchar(32) NOT NULL default '', MEMBER_NAME varchar(32) NOT NULL default '', MEMBER_ID varchar(32) NOT NULL default '', SESSION_KEY varchar(32) NOT NULL default '', LOCATION varchar(64) default 'index', LOG_IN_TIME int(10) NOT NULL default '0', RUNNING_TIME int(10) NOT NULL default '0', PRIMARY KEY (ID) ); CREATE TABLE ibf_attachments ( id bigint(20) NOT NULL auto_increment, mime_type varchar(128) default NULL, file_name varchar(64) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_badwords ( wid int(3) NOT NULL auto_increment, type varchar(250) NOT NULL default '', swop varchar(250) default NULL, m_exact tinyint(1) default '0', PRIMARY KEY (wid) ); CREATE TABLE ibf_categories ( id tinyint(3) NOT NULL default '0', position tinyint(3) default NULL, state varchar(10) default NULL, name varchar(128) NOT NULL default '', description text, image varchar(128) default NULL, url varchar(128) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_contacts ( id bigint(20) NOT NULL auto_increment, contact_id varchar(32) NOT NULL default '', member_id varchar(32) NOT NULL default '', contact_name varchar(32) NOT NULL default '', allow_msg tinyint(1) default NULL, contact_desc varchar(50) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_css ( cssid int(10) NOT NULL auto_increment, css_name varchar(128) NOT NULL default '', css_text text, PRIMARY KEY (cssid) ); CREATE TABLE ibf_emoticons ( id smallint(3) NOT NULL auto_increment, typed varchar(32) NOT NULL default '', image varchar(128) NOT NULL default '', clickable smallint(2) NOT NULL default '1', PRIMARY KEY (id) ); CREATE TABLE ibf_faq ( id bigint(20) NOT NULL auto_increment, title varchar(128) NOT NULL default '', text text, description text NOT NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_forums ( id smallint(5) NOT NULL default '0', topics mediumint(6) default NULL, posts mediumint(6) default NULL, last_post int(10) default NULL, last_poster_id varchar(32) default NULL, last_poster_name varchar(32) default NULL, name varchar(128) NOT NULL default '', description text, position tinyint(2) default NULL, use_ibc tinyint(1) default NULL, use_html tinyint(1) default NULL, status varchar(10) default NULL, start_perms varchar(200) default NULL, reply_perms varchar(200) default NULL, read_perms varchar(200) default NULL, password varchar(32) default NULL, category tinyint(2) NOT NULL default '0', last_title varchar(128) default NULL, last_id smallint(5) default NULL, sort_key varchar(32) default NULL, sort_order varchar(32) default NULL, prune tinyint(3) default NULL, show_rules tinyint(1) default NULL, use_attach tinyint(1) default NULL, preview_posts tinyint(1) default NULL, allow_poll tinyint(1) NOT NULL default '1', allow_pollbump tinyint(1) NOT NULL default '0', inc_postcount tinyint(1) NOT NULL default '1', skin_id int(10) default NULL, parent_id mediumint(5) default '-1', subwrap tinyint(1) default '0', PRIMARY KEY (id), KEY category (category) ); CREATE TABLE ibf_groups ( g_id int(3) unsigned NOT NULL auto_increment, g_view_board tinyint(1) default NULL, g_mem_info tinyint(1) default NULL, g_other_topics tinyint(1) default NULL, g_use_search tinyint(1) default NULL, g_email_friend tinyint(1) default NULL, g_invite_friend tinyint(1) default NULL, g_edit_profile tinyint(1) default NULL, g_post_new_topics tinyint(1) default NULL, g_reply_own_topics tinyint(1) default NULL, g_reply_other_topics tinyint(1) default NULL, g_edit_posts tinyint(1) default NULL, g_delete_own_posts tinyint(1) default NULL, g_open_close_posts tinyint(1) default NULL, g_delete_own_topics tinyint(1) default NULL, g_post_polls tinyint(1) default NULL, g_vote_polls tinyint(1) default NULL, g_use_pm tinyint(1) default NULL, g_is_supmod tinyint(1) default NULL, g_access_cp tinyint(1) default NULL, g_title varchar(32) NOT NULL default '', g_can_remove tinyint(1) default NULL, g_append_edit tinyint(1) default NULL, g_access_offline tinyint(1) default NULL, g_avoid_q tinyint(1) default NULL, g_avoid_flood tinyint(1) default NULL, g_icon varchar(64) default NULL, g_attach_max bigint(20) default NULL, g_avatar_upload tinyint(1) default '0', g_calendar_post tinyint(1) default '0', prefix varchar(250) default NULL, suffix varchar(250) default NULL, PRIMARY KEY (g_id) ); CREATE TABLE ibf_images ( imid int(10) NOT NULL auto_increment, setname varchar(125) NOT NULL default '', A_LOCKED_B varchar(250) default NULL, A_MOVED_B varchar(250) default NULL, A_POLL varchar(250) default NULL, A_POLLONLY_B varchar(250) default NULL, A_POST varchar(250) default NULL, A_REPLY varchar(250) default NULL, A_STAR varchar(250) default NULL, B_HOT varchar(250) default NULL, B_HOT_NN varchar(250) default NULL, B_LOCKED varchar(250) default NULL, B_MOVED varchar(250) default NULL, B_NEW varchar(250) default NULL, B_NORM varchar(250) default NULL, B_PIN varchar(250) default NULL, B_POLL varchar(250) default NULL, B_POLL_NN varchar(250) default NULL, C_LOCKED varchar(250) default NULL, C_OFF varchar(250) default NULL, C_OFF_CAT varchar(250) default NULL, C_OFF_RES varchar(250) default NULL, C_ON varchar(250) default NULL, C_ON_CAT varchar(250) default NULL, C_ON_RES varchar(250) default NULL, F_ACTIVE varchar(250) default NULL, F_NAV_SEP varchar(250) default NULL, F_NAV varchar(250) default NULL, F_STATS varchar(250) default NULL, GO_LAST_ON varchar(250) default NULL, GO_LAST_OFF varchar(250) default NULL, M_ADDMEM varchar(250) default NULL, M_DELETE varchar(250) default NULL, M_READ varchar(250) default NULL, M_REPLY varchar(250) default NULL, M_UNREAD varchar(250) default NULL, P_AOL varchar(250) default NULL, P_DELETE varchar(250) default NULL, P_EDIT varchar(250) default NULL, P_EMAIL varchar(250) default NULL, P_ICQ varchar(250) default NULL, P_MSG varchar(250) default NULL, P_PROFILE varchar(250) default NULL, P_QUOTE varchar(250) default NULL, P_WEBSITE varchar(250) default NULL, CAT_IMG varchar(250) default NULL, B_HOT_DOT varchar(250) default NULL, B_NEW_DOT varchar(250) default NULL, B_HOT_NN_DOT varchar(250) default NULL, B_NORM_DOT varchar(250) default NULL, B_POLL_DOT varchar(250) default NULL, B_POLL_NN_DOT varchar(250) default NULL, NEW_POST varchar(250) default NULL, PRIMARY KEY (imid) ); CREATE TABLE ibf_member_extra ( id bigint(20) NOT NULL default '0', notes text, links text, bio text, ta_size char(3) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_members ( id bigint(10) NOT NULL default '0', name varchar(32) NOT NULL default '', mgroup tinyint(2) NOT NULL default '0', password varchar(32) NOT NULL default '', email varchar(60) NOT NULL default '', joined int(10) NOT NULL default '0', ip_address varchar(16) NOT NULL default '', avatar varchar(128) default NULL, avatar_size varchar(9) default NULL, posts mediumint(7) default '0', photo varchar(70) default NULL, aim_name varchar(40) default NULL, icq_number varchar(40) default NULL, location varchar(128) default NULL, signature text, website varchar(70) default NULL, yahoo varchar(32) default NULL, title varchar(64) default NULL, allow_admin_mails tinyint(1) default NULL, time_offset varchar(10) default NULL, interests text, hide_email varchar(8) default NULL, email_pm tinyint(1) default NULL, email_full tinyint(1) default NULL, skin smallint(5) default NULL, warn_level int(10) default NULL, language varchar(32) default NULL, msnname varchar(64) default NULL, last_post int(10) default NULL, allow_post tinyint(1) default '1', view_sigs tinyint(1) default '1', view_img tinyint(1) default '1', view_avs tinyint(1) default '1', view_pop tinyint(1) default '1', bday_day int(2) default NULL, bday_month int(2) default NULL, bday_year int(4) default NULL, new_msg tinyint(2) default NULL, msg_from_id varchar(32) default NULL, msg_msg_id int(10) default NULL, msg_total smallint(5) default NULL, vdirs text, show_popup tinyint(1) default NULL, validate_key varchar(32) default NULL, prev_group smallint(3) default '0', new_pass varchar(32) default NULL, misc varchar(128) default NULL, last_visit int(10) default '0', last_activity int(10) default '0', dst_in_use tinyint(1) default '0', PRIMARY KEY (id), KEY name (name), KEY mgroup (mgroup) ); CREATE TABLE ibf_messages ( msg_id bigint(20) NOT NULL auto_increment, msg_date int(10) default NULL, read_state tinyint(1) default NULL, title varchar(128) default NULL, message text, from_id varchar(32) default NULL, vid varchar(32) default NULL, member_id varchar(32) NOT NULL default '0', recipient_id varchar(32) default NULL, attach_type tinyint(128) default NULL, attach_file tinyint(128) default NULL, PRIMARY KEY (msg_id), KEY member_id (member_id) ); CREATE TABLE ibf_moderator_logs ( id bigint(20) NOT NULL auto_increment, forum_id int(5) default '0', topic_id bigint(20) default '0', post_id bigint(20) default '0', member_id varchar(32) NOT NULL default '', member_name varchar(32) NOT NULL default '', ip_address varchar(32) default NULL, http_referer varchar(255) default NULL, ctime int(10) default NULL, topic_title varchar(128) default NULL, action varchar(128) default NULL, query_string varchar(128) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_moderators ( mid bigint(20) NOT NULL auto_increment, forum_id int(5) NOT NULL default '0', member_name varchar(32) NOT NULL default '', member_id varchar(32) NOT NULL default '0', edit_post tinyint(1) default NULL, edit_topic tinyint(1) default NULL, delete_post tinyint(1) default NULL, delete_topic tinyint(1) default NULL, view_ip tinyint(1) default NULL, open_topic tinyint(1) default NULL, close_topic tinyint(1) default NULL, mass_move tinyint(1) default NULL, mass_prune tinyint(1) default NULL, move_topic tinyint(1) default NULL, pin_topic tinyint(1) default NULL, unpin_topic tinyint(1) default NULL, post_q tinyint(1) default NULL, topic_q tinyint(1) default NULL, allow_warn tinyint(1) default NULL, edit_user tinyint(1) NOT NULL default '0', PRIMARY KEY (mid) ); CREATE TABLE ibf_polls ( pid bigint(20) NOT NULL auto_increment, tid bigint(20) NOT NULL default '0', start_date int(10) default NULL, choices text, starter_id varchar(32) default NULL, votes bigint(20) default NULL, forum_id bigint(20) default NULL, PRIMARY KEY (pid) ); CREATE TABLE ibf_posts ( pid bigint(20) NOT NULL auto_increment, author_id int(10) default NULL, author_name varchar(32) default NULL, use_sig varchar(8) default NULL, use_emo varchar(8) default NULL, ip_address varchar(32) default NULL, post_date int(10) default NULL, icon_id smallint(3) default NULL, post text, queued tinyint(1) default NULL, topic_id bigint(20) default NULL, forum_id int(10) default NULL, attach_id varchar(64) default NULL, attach_hits int(10) default NULL, attach_type varchar(128) default NULL, attach_file varchar(255) default NULL, post_title varchar(255) default NULL, new_topic tinyint(1) default '0', PRIMARY KEY (pid), KEY forum_id (forum_id), KEY topic_id (topic_id,author_id), KEY author_id (author_id) ); CREATE TABLE ibf_rules ( fid mediumint(6) NOT NULL default '0', title varchar(128) NOT NULL default '', body text, updated int(10) default NULL, show_all tinyint(1) default NULL, PRIMARY KEY (fid) ); CREATE TABLE ibf_search_results ( id varchar(32) NOT NULL default '', topics text NOT NULL, search_date int(12) NOT NULL default '0', max_hits int(3) NOT NULL default '0', sort_key varchar(32) NOT NULL default 'last_post', sort_order varchar(4) NOT NULL default 'desc' ); CREATE TABLE ibf_sessions ( id varchar(32) NOT NULL default '0', member_name varchar(64) default NULL, member_pass varchar(32) default NULL, member_id varchar(32) default NULL, ip_address varchar(16) default NULL, start_session int(10) default NULL, browser varchar(64) default NULL, running_time int(10) default NULL, login_type tinyint(1) default NULL, location varchar(40) default NULL, member_group smallint(3) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_skins ( uid int(10) NOT NULL auto_increment, sname varchar(100) NOT NULL default '', sid int(10) NOT NULL default '0', set_id int(5) NOT NULL default '0', tmpl_id int(10) NOT NULL default '0', img_id int(10) NOT NULL default '1', css_id int(10) NOT NULL default '1', tbl_width varchar(250) default NULL, tbl_border varchar(250) default NULL, hidden tinyint(1) NOT NULL default '0', default_set tinyint(1) NOT NULL default '0', PRIMARY KEY (uid) ); CREATE TABLE ibf_stats ( TOTAL_REPLIES bigint(20) NOT NULL default '0', TOTAL_TOPICS bigint(20) NOT NULL default '0', LAST_MEM_NAME varchar(32) default NULL, LAST_MEM_ID varchar(32) default NULL, MOST_DATE int(10) default NULL, MOST_COUNT int(10) default '0', MEM_COUNT bigint(20) default '0' ); CREATE TABLE ibf_templates ( tmid int(10) NOT NULL auto_increment, template mediumtext, name varchar(128) default NULL, PRIMARY KEY (tmid) ); CREATE TABLE ibf_titles ( id smallint(5) NOT NULL auto_increment, posts int(10) default NULL, title varchar(128) default NULL, pips varchar(128) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_tmpl_names ( skid int(10) NOT NULL auto_increment, skname varchar(60) NOT NULL default 'Invision Board', author varchar(250) default '', email varchar(250) default '', url varchar(250) default '', PRIMARY KEY (skid) ); CREATE TABLE ibf_topics ( tid bigint(20) NOT NULL auto_increment, title varchar(70) NOT NULL default '', description varchar(70) default NULL, state varchar(8) default NULL, posts smallint(4) default NULL, starter_id varchar(32) default NULL, start_date int(10) default NULL, last_poster_id varchar(32) default NULL, last_post int(10) default NULL, icon_id tinyint(2) default NULL, starter_name varchar(32) default NULL, last_poster_name varchar(32) default NULL, poll_state varchar(8) default NULL, last_vote int(10) default NULL, views smallint(5) default NULL, forum_id smallint(5) default NULL, approved tinyint(1) default NULL, author_mode tinyint(1) default NULL, pinned tinyint(1) default NULL, moved_to varchar(64) default NULL, rating text, total_votes int(5) NOT NULL default '0', PRIMARY KEY (tid), KEY forum_id (forum_id) ); CREATE TABLE ibf_tracker ( trid bigint(20) NOT NULL auto_increment, member_id varchar(32) NOT NULL default '', topic_id bigint(20) NOT NULL default '0', start_date int(10) default NULL, last_sent int(10) NOT NULL default '0', PRIMARY KEY (trid) ); CREATE TABLE ibf_voters ( vid bigint(20) NOT NULL auto_increment, ip_address varchar(16) NOT NULL default '', vote_date int(10) NOT NULL default '0', tid bigint(20) NOT NULL default '0', member_id varchar(32) default NULL, forum_id bigint(20) default NULL, PRIMARY KEY (vid) ); CREATE TABLE ibf_languages ( lid bigint(20) NOT NULL auto_increment, ldir varchar(64) NOT NULL, lname varchar(250) NOT NULL, lauthor varchar(250) default NULL, lemail varchar(250) default NULL, PRIMARY KEY (lid) ); \ No newline at end of file +CREATE TABLE ibf_admin_logs ( id bigint(20) NOT NULL auto_increment, act varchar(255) default NULL, code varchar(255) default NULL, member_id int(10) default NULL, ctime int(10) default NULL, note text, ip_address varchar(255) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_admin_sessions ( ID varchar(32) NOT NULL default '', IP_ADDRESS varchar(32) NOT NULL default '', MEMBER_NAME varchar(32) NOT NULL default '', MEMBER_ID varchar(32) NOT NULL default '', SESSION_KEY varchar(32) NOT NULL default '', LOCATION varchar(64) default 'index', LOG_IN_TIME int(10) NOT NULL default '0', RUNNING_TIME int(10) NOT NULL default '0', PRIMARY KEY (ID) ); CREATE TABLE ibf_attachments ( id bigint(20) NOT NULL auto_increment, mime_type varchar(128) default NULL, file_name varchar(64) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_badwords ( wid int(3) NOT NULL auto_increment, type varchar(250) NOT NULL default '', swop varchar(250) default NULL, m_exact tinyint(1) default '0', PRIMARY KEY (wid) ); CREATE TABLE ibf_calendar_events ( eventid bigint(20) NOT NULL auto_increment, userid bigint(20) NOT NULL default '0', year int(4) NOT NULL default '2002', month int(2) NOT NULL default '1', mday int(2) NOT NULL default '1', title varchar(254) NOT NULL default 'no title', event_text text NOT NULL, read_perms varchar(254) NOT NULL default '*', unix_stamp int(10) NOT NULL default '0', priv_event tinyint(1) NOT NULL default '0', show_emoticons tinyint(1) NOT NULL default '1', rating smallint(2) NOT NULL default '1', PRIMARY KEY (eventid), KEY unix_stamp (unix_stamp) ); CREATE TABLE ibf_categories ( id smallint(5) NOT NULL default '0', position tinyint(3) default NULL, state varchar(10) default NULL, name varchar(128) NOT NULL default '', description text, image varchar(128) default NULL, url varchar(128) default NULL, PRIMARY KEY (id), KEY id (id) ); CREATE TABLE ibf_contacts ( id bigint(20) NOT NULL auto_increment, contact_id varchar(32) NOT NULL default '', member_id varchar(32) NOT NULL default '', contact_name varchar(32) NOT NULL default '', allow_msg tinyint(1) default NULL, contact_desc varchar(50) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_css ( cssid int(10) NOT NULL auto_increment, css_name varchar(128) NOT NULL default '', css_text text, css_comments text, PRIMARY KEY (cssid) ); CREATE TABLE ibf_emoticons ( id smallint(3) NOT NULL auto_increment, typed varchar(32) NOT NULL default '', image varchar(128) NOT NULL default '', clickable smallint(2) NOT NULL default '1', PRIMARY KEY (id) ); CREATE TABLE ibf_faq ( id bigint(20) NOT NULL auto_increment, title varchar(128) NOT NULL default '', text text, description text NOT NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_forum_tracker ( frid bigint(20) NOT NULL auto_increment, member_id varchar(32) NOT NULL default '', forum_id int(10) NOT NULL default '0', start_date int(10) default NULL, last_sent int(10) NOT NULL default '0', PRIMARY KEY (frid) ); CREATE TABLE ibf_forums ( id smallint(5) NOT NULL default '0', topics mediumint(6) default NULL, posts mediumint(6) default NULL, last_post int(10) default NULL, last_poster_id int(10) default NULL, last_poster_name varchar(32) default NULL, name varchar(128) NOT NULL default '', description text, position tinyint(2) default NULL, use_ibc tinyint(1) default NULL, use_html tinyint(1) default NULL, status varchar(10) default NULL, start_perms varchar(32) default NULL, reply_perms varchar(32) default NULL, read_perms varchar(32) default NULL, password varchar(32) default NULL, category tinyint(2) NOT NULL default '0', last_title varchar(128) default NULL, last_id int(10) default NULL, sort_key varchar(32) default NULL, sort_order varchar(32) default NULL, prune tinyint(3) default NULL, show_rules tinyint(1) default NULL, upload_perms varchar(255) default NULL, preview_posts tinyint(1) default NULL, allow_poll tinyint(1) NOT NULL default '1', allow_pollbump tinyint(1) NOT NULL default '0', inc_postcount tinyint(1) NOT NULL default '1', skin_id int(10) default NULL, parent_id mediumint(5) default '-1', subwrap tinyint(1) default '0', sub_can_post tinyint(1) default '1', PRIMARY KEY (id), KEY category (category), KEY id (id) ); CREATE TABLE ibf_groups ( g_id int(3) unsigned NOT NULL auto_increment, g_view_board tinyint(1) default NULL, g_mem_info tinyint(1) default NULL, g_other_topics tinyint(1) default NULL, g_use_search tinyint(1) default NULL, g_email_friend tinyint(1) default NULL, g_invite_friend tinyint(1) default NULL, g_edit_profile tinyint(1) default NULL, g_post_new_topics tinyint(1) default NULL, g_reply_own_topics tinyint(1) default NULL, g_reply_other_topics tinyint(1) default NULL, g_edit_posts tinyint(1) default NULL, g_delete_own_posts tinyint(1) default NULL, g_open_close_posts tinyint(1) default NULL, g_delete_own_topics tinyint(1) default NULL, g_post_polls tinyint(1) default NULL, g_vote_polls tinyint(1) default NULL, g_use_pm tinyint(1) default NULL, g_is_supmod tinyint(1) default NULL, g_access_cp tinyint(1) default NULL, g_title varchar(32) NOT NULL default '', g_can_remove tinyint(1) default NULL, g_append_edit tinyint(1) default NULL, g_access_offline tinyint(1) default NULL, g_avoid_q tinyint(1) default NULL, g_avoid_flood tinyint(1) default NULL, g_icon varchar(64) default NULL, g_attach_max bigint(20) default NULL, g_avatar_upload tinyint(1) default '0', g_calendar_post tinyint(1) default '0', prefix varchar(250) default NULL, suffix varchar(250) default NULL, g_max_messages int(5) default '50', g_max_mass_pm int(5) default '0', g_search_flood mediumint(6) default '20', g_edit_cutoff int(10) default '0', g_promotion varchar(10) default '-1&-1', g_hide_from_list tinyint(1) default '0', g_post_closed tinyint(1) default '0', PRIMARY KEY (g_id) ); CREATE TABLE ibf_languages ( lid bigint(20) NOT NULL auto_increment, ldir varchar(64) NOT NULL default '', lname varchar(250) NOT NULL default '', lauthor varchar(250) default NULL, lemail varchar(250) default NULL, PRIMARY KEY (lid) ); CREATE TABLE ibf_macro ( macro_id smallint(3) NOT NULL auto_increment, macro_value varchar(200) default NULL, macro_replace text, can_remove tinyint(1) default '0', macro_set smallint(3) default NULL, PRIMARY KEY (macro_id), KEY macro_set (macro_set) ); CREATE TABLE ibf_macro_name ( set_id smallint(3) NOT NULL default '0', set_name varchar(200) default NULL, PRIMARY KEY (set_id) ); CREATE TABLE ibf_member_extra ( id bigint(20) NOT NULL default '0', notes text, links text, bio text, ta_size char(3) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_members ( id bigint(10) NOT NULL default '0', name varchar(32) NOT NULL default '', mgroup tinyint(2) NOT NULL default '0', password varchar(32) NOT NULL default '', email varchar(60) NOT NULL default '', joined int(10) NOT NULL default '0', ip_address varchar(16) NOT NULL default '', avatar varchar(128) default NULL, avatar_size varchar(9) default NULL, posts mediumint(7) default '0', aim_name varchar(40) default NULL, icq_number varchar(40) default NULL, location varchar(128) default NULL, signature text, website varchar(70) default NULL, yahoo varchar(32) default NULL, title varchar(64) default NULL, allow_admin_mails tinyint(1) default NULL, time_offset varchar(10) default NULL, interests text, hide_email varchar(8) default NULL, email_pm tinyint(1) default NULL, email_full tinyint(1) default NULL, skin smallint(5) default NULL, warn_level int(10) default NULL, language varchar(32) default NULL, msnname varchar(64) default NULL, last_post int(10) default NULL, allow_post tinyint(1) default '1', view_sigs tinyint(1) default '1', view_img tinyint(1) default '1', view_avs tinyint(1) default '1', view_pop tinyint(1) default '1', bday_day int(2) default NULL, bday_month int(2) default NULL, bday_year int(4) default NULL, new_msg tinyint(2) default NULL, msg_from_id varchar(32) default NULL, msg_msg_id int(10) default NULL, msg_total smallint(5) default NULL, vdirs text, show_popup tinyint(1) default NULL, validate_key varchar(32) default NULL, prev_group smallint(3) default '0', new_pass varchar(32) default NULL, misc varchar(128) default NULL, last_visit int(10) default '0', last_activity int(10) default '0', dst_in_use tinyint(1) default '0', view_prefs varchar(64) default '-1&-1', coppa_user tinyint(1) default '0', mod_posts tinyint(1) default '0', auto_track tinyint(1) default '0', PRIMARY KEY (id), KEY name (name), KEY mgroup (mgroup), KEY bday_day (bday_day), KEY bday_month (bday_month) ); CREATE TABLE ibf_messages ( msg_id bigint(20) NOT NULL auto_increment, msg_date int(10) default NULL, read_state tinyint(1) default NULL, title varchar(128) default NULL, message text, from_id varchar(32) default NULL, vid varchar(32) default NULL, member_id varchar(32) NOT NULL default '0', recipient_id varchar(32) default NULL, attach_type tinyint(128) default NULL, attach_file tinyint(128) default NULL, cc_users text, tracking tinyint(1) default '0', read_date int(10) default NULL, PRIMARY KEY (msg_id), KEY member_id (member_id), KEY vid (vid) ); CREATE TABLE ibf_moderator_logs ( id bigint(20) NOT NULL auto_increment, forum_id int(5) default '0', topic_id bigint(20) default '0', post_id bigint(20) default '0', member_id varchar(32) NOT NULL default '', member_name varchar(32) NOT NULL default '', ip_address varchar(32) default NULL, http_referer varchar(255) default NULL, ctime int(10) default NULL, topic_title varchar(128) default NULL, action varchar(128) default NULL, query_string varchar(128) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_moderators ( mid bigint(20) NOT NULL auto_increment, forum_id int(5) NOT NULL default '0', member_name varchar(32) NOT NULL default '', member_id varchar(32) NOT NULL default '0', edit_post tinyint(1) default NULL, edit_topic tinyint(1) default NULL, delete_post tinyint(1) default NULL, delete_topic tinyint(1) default NULL, view_ip tinyint(1) default NULL, open_topic tinyint(1) default NULL, close_topic tinyint(1) default NULL, mass_move tinyint(1) default NULL, mass_prune tinyint(1) default NULL, move_topic tinyint(1) default NULL, pin_topic tinyint(1) default NULL, unpin_topic tinyint(1) default NULL, post_q tinyint(1) default NULL, topic_q tinyint(1) default NULL, allow_warn tinyint(1) default NULL, edit_user tinyint(1) NOT NULL default '0', is_group tinyint(1) default '0', group_id smallint(3) default NULL, group_name varchar(200) default NULL, split_merge tinyint(1) default '0', PRIMARY KEY (mid), KEY forum_id (forum_id), KEY group_id (group_id), KEY member_id (member_id) ); CREATE TABLE ibf_pfields_content ( member_id bigint(20) NOT NULL default '0', updated int(10) default '0', PRIMARY KEY (member_id) ); CREATE TABLE ibf_pfields_data ( fid smallint(5) NOT NULL auto_increment, ftitle varchar(200) NOT NULL default '', fdesc varchar(250) default '', fcontent text, ftype varchar(250) default 'text', freq tinyint(1) default '0', fhide tinyint(1) default '0', fmaxinput smallint(6) default '250', fedit tinyint(1) default '1', forder smallint(6) default '1', fshowreg tinyint(1) default '0', PRIMARY KEY (fid) ); CREATE TABLE ibf_polls ( pid bigint(20) NOT NULL auto_increment, tid bigint(20) NOT NULL default '0', start_date int(10) default NULL, choices text, starter_id varchar(32) default NULL, votes bigint(20) default NULL, forum_id bigint(20) default NULL, poll_question varchar(255) default NULL, PRIMARY KEY (pid) ); CREATE TABLE ibf_posts ( append_edit tinyint(1) default '0', edit_time int(10) default NULL, pid bigint(20) NOT NULL auto_increment, author_id int(10) NOT NULL default '0', author_name varchar(32) default NULL, use_sig varchar(8) default NULL, use_emo varchar(8) default NULL, ip_address varchar(32) default NULL, post_date int(10) default NULL, icon_id smallint(3) default NULL, post text, queued tinyint(1) default NULL, topic_id bigint(20) NOT NULL default '0', forum_id int(10) NOT NULL default '0', attach_id varchar(64) default NULL, attach_hits int(10) default NULL, attach_type varchar(128) default NULL, attach_file varchar(255) default NULL, post_title varchar(255) default NULL, new_topic tinyint(1) default '0', edit_name varchar(255) default NULL, PRIMARY KEY (pid), KEY topic_id (topic_id,author_id), KEY author_id (author_id), KEY forum_id (forum_id,post_date) ); CREATE TABLE ibf_reg_antispam ( regid varchar(32) NOT NULL default '', regcode varchar(8) NOT NULL default '', ip_address varchar(32) default NULL, ctime int(10) default NULL, PRIMARY KEY (regid) ); CREATE TABLE ibf_rules ( fid mediumint(6) NOT NULL default '0', title varchar(128) NOT NULL default '', body text, updated int(10) default NULL, show_all tinyint(1) default NULL, PRIMARY KEY (fid) ); CREATE TABLE ibf_search_results ( id varchar(32) NOT NULL default '', topic_id text NOT NULL, search_date int(12) NOT NULL default '0', topic_max int(3) NOT NULL default '0', sort_key varchar(32) NOT NULL default 'last_post', sort_order varchar(4) NOT NULL default 'desc', member_id mediumint(10) default '0', ip_address varchar(64) default NULL, post_id text, post_max int(10) NOT NULL default '0' ); CREATE TABLE ibf_sessions ( id varchar(32) NOT NULL default '0', member_name varchar(64) default NULL, member_id varchar(32) default NULL, ip_address varchar(16) default NULL, browser varchar(64) default NULL, running_time int(10) default NULL, login_type tinyint(1) default NULL, location varchar(40) default NULL, member_group smallint(3) default NULL, in_forum int(10) default NULL, in_topic int(10) default NULL, PRIMARY KEY (id), KEY in_topic (in_topic), KEY in_forum (in_forum) ); CREATE TABLE ibf_skin_templates ( suid int(10) NOT NULL auto_increment, set_id int(10) NOT NULL default '0', group_name varchar(255) NOT NULL default '', section_content mediumtext, func_name varchar(255) default NULL, func_data text, updated int(10) default NULL, can_remove tinyint(4) default '0', PRIMARY KEY (suid) ); CREATE TABLE ibf_skins ( uid int(10) NOT NULL auto_increment, sname varchar(100) NOT NULL default '', sid int(10) NOT NULL default '0', set_id int(5) NOT NULL default '0', tmpl_id int(10) NOT NULL default '0', macro_id int(10) NOT NULL default '1', css_id int(10) NOT NULL default '1', img_dir varchar(200) default '1', hidden tinyint(1) NOT NULL default '0', default_set tinyint(1) NOT NULL default '0', PRIMARY KEY (uid), KEY tmpl_id (tmpl_id), KEY css_id (css_id) ); CREATE TABLE ibf_stats ( TOTAL_REPLIES bigint(20) NOT NULL default '0', TOTAL_TOPICS bigint(20) NOT NULL default '0', LAST_MEM_NAME varchar(32) default NULL, LAST_MEM_ID varchar(32) default NULL, MOST_DATE int(10) default NULL, MOST_COUNT int(10) default '0', MEM_COUNT bigint(20) default '0' ); CREATE TABLE ibf_templates ( tmid int(10) NOT NULL auto_increment, template mediumtext, name varchar(128) default NULL, PRIMARY KEY (tmid) ); CREATE TABLE ibf_titles ( id smallint(5) NOT NULL auto_increment, posts int(10) default NULL, title varchar(128) default NULL, pips varchar(128) default NULL, PRIMARY KEY (id) ); CREATE TABLE ibf_tmpl_names ( skid int(10) NOT NULL auto_increment, skname varchar(60) NOT NULL default 'Invision Board', author varchar(250) default '', email varchar(250) default '', url varchar(250) default '', PRIMARY KEY (skid) ); CREATE TABLE ibf_topics ( tid bigint(20) NOT NULL auto_increment, title varchar(70) NOT NULL default '', description varchar(70) default NULL, state varchar(8) default NULL, posts smallint(4) default NULL, starter_id varchar(32) default NULL, start_date int(10) default NULL, last_poster_id varchar(32) default NULL, last_post int(10) default NULL, icon_id tinyint(2) default NULL, starter_name varchar(32) default NULL, last_poster_name varchar(32) default NULL, poll_state varchar(8) default NULL, last_vote int(10) default NULL, views smallint(5) default NULL, forum_id smallint(5) NOT NULL default '0', approved tinyint(1) default NULL, author_mode tinyint(1) default NULL, pinned tinyint(1) default NULL, moved_to varchar(64) default NULL, rating text, total_votes int(5) NOT NULL default '0', PRIMARY KEY (tid), KEY forum_id (forum_id,approved,pinned,last_post) ); CREATE TABLE ibf_tracker ( trid bigint(20) NOT NULL auto_increment, member_id varchar(32) NOT NULL default '', topic_id bigint(20) NOT NULL default '0', start_date int(10) default NULL, last_sent int(10) NOT NULL default '0', PRIMARY KEY (trid) ); CREATE TABLE ibf_voters ( vid bigint(20) NOT NULL auto_increment, ip_address varchar(16) NOT NULL default '', vote_date int(10) NOT NULL default '0', tid bigint(20) NOT NULL default '0', member_id varchar(32) default NULL, forum_id bigint(20) default NULL, PRIMARY KEY (vid) ); \ No newline at end of file diff --git a/upgrade_v101.html b/upgrade_v101.html new file mode 100644 index 00000000..52326a6d --- /dev/null +++ b/upgrade_v101.html @@ -0,0 +1,177 @@ + + + + + Invision Upgrade Guide + + + + + + + + + + +
    + Sections: Introduction | Upgrading | HELP!! | Getting Further Help +
    + +
    + + + + + + + + +
    Welcome!
    + Synopsis: Upgrading from v1.0.x to v1.1 +
    + To upgrade your existing board from Invision Board v1.0.x to Invision Board v1.1, you'll need to update all the program files and + run an upgrade script that is included in this distribution. You may want to create a database back up and download via FTP any + existing language packs and skin files as these may be over-written during the upgrade. +

    + Important: Skins and Upload Permissions +
    + The skinning system in Invision Board v1.1 is radically different from v1. This change brings many enhancements such as full online + template editing and a more powerful macro set function. These changes do mean that any existing skins will not be compatible with + v1.1. The upgrade script will change all existing skins to "hidden" and install a new default set for you. +
    Your members will also be updated, moving them from any existing skin choices to the new default skin set. It's also worth noting that + the upload permissions system has changed. The installer will remove all existing forum upload permissions to ensure that + no error occurs after the upgrade. + +
    + +
    + + + + + + + + +
    Upgrading
    + Saving Old Data +
    + If you wish to save the information in the old default skin, please do the following: +
    + Via FTP download the directories "Skin/s1/" and "style_images/1/". The upgrade will need the + v1.1 files to reside in those directories and any previous data will be lost. +

    + Uploading the Files +
    + From the unzipped package, upload the following files to the same directory that your existing board is in: +
    admin.php +
    index.php +
    install_templates.txt +
    show.php +
    upgrade4.php
    +

    Upload the directories (and any contents / sub directories): +
    + lang/en/*.php (All PHP files. Create the directory if it's not there and upload into it) +
    + Skin/s1/*.php (All PHP files. Create the directory if it's not there and upload into it) +
    + sources/*.* (All PHP files and sub folders) +
    + style_images/1/ (All files. Create the directory "1" if it's not there and upload into it)
    +

    + In short: Upload everything as if it were a new install! +

    + Please check the following before you proceed +
    You MUST ensure that the new skin PHP files are in a directory called "Skin/s1/" - if you have previously removed "s1" from the "Skins" directory, please re-create it via FTP and upload the skin PHP files into it. +

    You MUST ensure that the new images are in a directory called "style_images/1/" - if you have previously + removed "1" from the "style_images" directory, please re-create it via FTP and upload the images into it. +

    You MUST make sure the file 'install_templates.txt' is uploaded into the same directory as 'index.php' +

    You MUST make sure the script 'upgrade4.php' is uploaded into the same directory as 'index.php' +

    + Running the upgrade script +
    + Open up a new browser window and enter the URL to the upgrade4.php script (example: www.board.com/forums/upgrade4.php) + Follow the onscreen instructions to update your database. +

    + If you get an error during the upgrade, try hitting back in your browser and try again. +
    + This script will upgrade your database, install new templates and perform a clean up. +

    + IMPORTANT: PLEASE REMOVE THE SCRIPT WHEN THE UPGRADE IS COMPLETED! +

    + That's it, you should be done! +
    + +
    + + + + + + + + +
    HELP!!: Common Problems
    + The upgrade worked fine, but I get a blank screen now!! +
    + The upgrade takes it's best guess when it creates the new skin set, it's not impossible that it might not match everything up. + If you get a blank screen, it's usually because the board wrapper it's chosen is broken / doesn't exist. Try the following: +
    Log into your Admin CP. Go to "Skins & Templates". Click on "Manage Skin Sets" and edit "IBF Default Set (NEW)" and make + sure it's got a valid template set and wrapper. +

    + I can't do anything, I get loads of errors!! +
    + This is always caused by a failure to update the files in "Skin/s1/" on your server. Simply put, they MUST be updated from + the ones included in this zip file (upload/Skins/s1). Upload the skins and refresh your browser. + +
    + +
    + + + + + + + + + +
    Getting further help
    + If you have a problem outside the ones solved in this guide, then don't panic!
    + We have a large team of trained support professionals that will be able to provide a solution to your problems.
    + Your first stop would be to open a new support ticket. The FREE ticket system is available from the Invision Board web site. When starting a new ticket, please + be as thorough as you can in your error reporting, it will save our team time in responding to you. We pride ourselves on quality, professional support and aim to answer your request as promptly as possible. +
    + You can also post a problem on our "Support and Community Forums". We have a large active community who have experience in maintaining their Invision Board who may be able to give you a prompt reply - our support professionals also moderate these forums and + will read your posts. We do recommend that you make use of the search facility on the board to avoid posting problems that have already been posted - there is also a good chance that it's already been reported, discussed and solved. +
    + +
    You may wish to consider our "Priority Support" option. A once only fee will cover you for all support requests for a period of one year (12 months). +
    Priority support entitles you to the following benefits: +
      +
    • Your support tickets will be marked priority and only Invision Board administrators will have access to those tickets. +
    • You will be given access to a private support forum on our Community Forums. +
    • If you are in the United States you will receive telephone support if desired. +
    • In most cases we will login to your account and address problems for you. +
    • We can install and upgrade the software for you if desired.
    +
    +For more information on our priority support service, please visit our advanced services page. +

    +If you wish to contact us for non-technical issues, please visit our Contact Page which includes a handy email form, mailing address and telephone number. +
    + + + + + - {$ibforums->lang['q_t_n']} - -EOF; -} - -function endcp() { -global $ibforums; -return << - - - - - -EOF; -} - -function post_none() { -global $ibforums; -return << - {$ibforums->lang['q_p_n']} - -EOF; -} - -function end_forum_splash() { -global $ibforums; -return << - - - -EOF; -} - -function post_form_header($count) { -global $ibforums; -return << - {$ibforums->lang['q_posts']} $count - -EOF; -} - -function prune_form_header() { -global $ibforums; -return << - {$ibforums->lang['search_prune']} - - - - {$ibforums->lang['define_search']} -
    - - - - - - - - {$ibforums->lang['s_prune_cutoff']} - - - - {$ibforums->lang['s_prune_perpage']} - - - -
    - -EOF; -} - -function show_post_results($data) { -global $ibforums; -return << - - {$ibforums->lang['a_topic_results']}
    - {$ibforums->lang['a_topic_deleted']} {$data[DELETED]}

    - {$ibforums->lang['a_topic_approved']} {$data[APPROVED]}

    - {$ibforums->lang['a_topic_left']} {$data[LEFT]}

    - - -EOF; -} - -function topic_header($data) { -global $ibforums; -return << - {$ibforums->lang['f_moderate']} {$data[FORUM_NAME]}
    {$ibforums->lang['f_moderate_t']} -
    - - - - - - - - - - - +HTML; +} + + +function cal_new_row() { +global $ibforums; + +return << + + + +HTML; +} + +function cal_blank_cell() { +global $ibforums; + +return <<
    + +HTML; +} + + +function cal_date_cell($month_day, $events="") { +global $ibforums; + +return <<$month_day $events + +HTML; +} + +function cal_date_cell_today($month_day, $events="") { +global $ibforums; + +return <<$month_day$events + +HTML; +} + + +function cal_events_start() { +global $ibforums; + +return <<--> +
    +HTML; +} + +function cal_events_wrap($link, $text) { +global $ibforums; + +return <<$text +HTML; +} + +function cal_events_end() { +global $ibforums; + +return <<--> +HTML; +} + +} +?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_emails.php b/upload/Skin/s1/skin_emails.php index 75d0be32..49d1e982 100644 --- a/upload/Skin/s1/skin_emails.php +++ b/upload/Skin/s1/skin_emails.php @@ -3,6 +3,83 @@ class skin_emails { +function report_form($fid, $tid, $pid, $st, $topic_title) { +global $ibforums; +return << + +
    - - - - - - - -EOF; -} - -function open_form_header() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function render_topic_post($data) { -global $ibforums; -return << - - - -EOF; -} - -function online_menu() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - -EOF; -} - -function show_topic_results($data) { -global $ibforums; -return << - - -EOF; -} - -function main_splash() { -global $ibforums; -return << - - - - - -EOF; -} - -function search_header($data) { -global $ibforums; -return << - - - - - -
    {$ibforums->lang['tt_action']}{$ibforums->lang['st_topic']}{$ibforums->lang['st_posts']}{$ibforums->lang['st_last']}
    {$ibforums->lang['search_openclose']} $count
    - {$ibforums->lang['define_search']} - - - - - -
    {$ibforums->lang['s_topics_cutoff']}
    {$ibforums->lang['s_sort']}
    {$ibforums->lang['s_limit']}
    - - - - - -
    {$data[POST]}->{'MEMBER_NAME'}{$ibforums->lang['ss_posted_on']} {$data[POST]}->{'POST_DATE'}
    {$data[POST]}->{'POST'} ( {$ibforums->lang['ss_read_more']} )
    -
    {$ibforums->lang['m_moderate']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$iB::IN{'f'}'>{$ibforums->lang['m_approve']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$iB::IN{'f'};CODE=prune'>{$ibforums->lang['m_prune']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$iB::IN{'f'};CODE=delete'>{$ibforums->lang['m_delete']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$iB::IN{'f'};CODE=open'>{$ibforums->lang['m_open']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$iB::IN{'f'};CODE=move'>{$ibforums->lang['m_move']}
    - {$ibforums->lang['a_post_results']}
    - {$ibforums->lang['a_post_deleted']} {$data[DELETED]}

    - {$ibforums->lang['a_post_approved']} {$data[APPROVED]}

    - {$ibforums->lang['a_post_left']} {$data[LEFT]}

    -
    {$ibforums->lang['mod_forum_t']}
    {$ibforums->lang['mod_forum']}
    - - - - -
    - - - - - - - -EOF; -} - -function move_form_header() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function delete_form_header() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function render_cat($data) { -global $ibforums; -return << - - -EOF; -} - -function topic_footer() { -global $ibforums; -return << - - -
    {$ibforums->lang['forum_name']}{$ibforums->lang['forum_topics']}{$ibforums->lang['forum_posts']}{$ibforums->lang['last_post']}
    {$ibforums->lang['search_move']}
    - {$ibforums->lang['define_search']} -
    - - - - -
    {$ibforums->lang['s_topics_cutoff']}
    {$ibforums->lang['s_sort']}
    {$ibforums->lang['s_limit']}
    {$ibforums->lang['search_delete']} $count
    - {$ibforums->lang['define_search']} -
    - - - - -
    {$ibforums->lang['s_topics_cutoff']}
    {$ibforums->lang['s_sort']}
    {$ibforums->lang['s_limit']}
    {$data[CAT_NAME]}
    -
    -EOF; -} - -function show_move_results($data) { -global $ibforums; -return << -
    - {$ibforums->lang['a_topic_results']}
    - {$ibforums->lang['a_topic_d_left']} {$data[leave]}

    - {$ibforums->lang['a_topic_moved']} {$data[move]}

    -
    {$ibforums->lang['f_moderate']} {$data[FORUM_NAME]}
    {$ibforums->lang['f_moderate_t']} -
    - - - - -
    - - - - - - - - -EOF; -} - -function foot() { -global $ibforums; -return << - -
    - - - - - -EOF; -} - -function move_ops($html, $forum_name) { -global $ibforums; -return << - - -EOF; -} - -function read_post($data) { -global $ibforums; -return << - - - -
    {$ibforums->lang['tt_action']}{$ibforums->lang['tt_details']}
    - - - - - - - - -
    {$ibforums->lang['move_topics_from']} $forum_name {$ibforums->lang['to']}: - - - - - - $html
    {$ibforums->lang['delete_old']} - -
    -
    - - - - -
    {$data[POST]}
    -
    -EOF; -} - -function forum_splash($data) { -global $ibforums; -return << -
    {$ibforums->lang['f_moderate']} {$data[FORUM_NAME]}
    {$ibforums->lang['f_moderate_t']}
    - - - - -EOF; -} - -function offline_menu() { -global $ibforums; -return << - - -EOF; -} - -function end_main_splash() { -global $ibforums; -return << - - -
    - -EOF; -} - -function show_open_results($data) { -global $ibforums; -return << - - -EOF; -} - -function render_topic_title($data) { -global $ibforums; -return << - - -EOF; -} - -function render_forum($data) { -global $ibforums; -return << - - - - -EOF; -} - -function render_newtopic($data) { -global $ibforums; -return << - - - - - -EOF; -} - -function topic_form() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - -EOF; -} - -function render_opentopic($data) { -global $ibforums; -return << - - - - - -EOF; -} - -function post_form() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - -EOF; -} - -function startcp() { -global $ibforums; -return << - - -
    - {$ibforums->lang['a_topic_results']}
    - {$ibforums->lang['a_topic_open']} {$data[open]}

    - {$ibforums->lang['a_topic_close']} {$data[closed]}

    -
    {$ibforums->lang['ss_topic_title']} {$data[TOPIC_TITLE]}
    {$data[FORUM_NAME]}
    {$ibforums->lang['topic_to_mod']} {$data[TOPICS_NOT_APPROVED]}
    {$data[FORUM_TOPICS]}{$data[FORUM_POSTS]}{$data[FORUM_LAST_POST]} -
    {$ibforums->lang['ss_topic_title']} {$data[TOPIC]}->{'TOPIC_TITLE'}
    - - - - - -
    {$data[TOPIC]}->{'TOPIC_STARTER_N'}{$ibforums->lang['ss_posted_on']} {$data[TOPIC]}->{'TOPIC_START_DATE'}
    {$data[POST]}->{'POST'} ( {$ibforums->lang['ss_read_more']} )
    -
    - {$ibforums->lang['define_search']} - - - - - -
    {$ibforums->lang['s_topics_cutoff']}
    {$ibforums->lang['s_sort']}
    {$ibforums->lang['s_limit']}
    {$data[SELECT]}{$data[TOPIC_TITLE]}
    {$data[TOPIC_DESC]}
    {$data[TOPIC_POSTS]}{$data[TOPIC_LAST_DATE]}
    {$ibforums->lang['st_by']} {$data[LAST_POSTER]}
    - {$ibforums->lang['define_search']} -
    - - - - -
    {$ibforums->lang['s_posts_cutoff']}
    {$ibforums->lang['s_sort']}
    {$ibforums->lang['s_limit']}
    - - - - -
    - - - - - -
    {$ibforums->lang['menu']}
    -
    - - - - - -EOF; -} - -function show_delete_results($data) { -global $ibforums; -return << - - -EOF; -} - -function search_footer() { -global $ibforums; -return << - - -
    {$ibforums->lang['display']}
    - {$ibforums->lang['a_topic_results']}
    - {$ibforums->lang['a_topic_d_delete']} {$data[delete]}

    -
    -
    -EOF; -} - -function topic_form_header($count) { -global $ibforums; -return << -
    {$ibforums->lang['q_topics']} $count
    {$ibforums->lang['menu_off']}
    -EOF; -} - - -} -?> \ No newline at end of file diff --git a/upload/Skin/s1/ReportView.php b/upload/Skin/s1/ReportView.php deleted file mode 100644 index bb31baf3..00000000 --- a/upload/Skin/s1/ReportView.php +++ /dev/null @@ -1,101 +0,0 @@ - -
    {$ibforums->lang['message']}

    {$ibforums->lang['warn']}
    - -
    -
    - -EOF; -} - -function header($data) { -global $ibforums; -return << - - - - - - - - - - - - - - - -EOF; -} - - -} -?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_boards.php b/upload/Skin/s1/skin_boards.php index e96ba238..9dcafda5 100644 --- a/upload/Skin/s1/skin_boards.php +++ b/upload/Skin/s1/skin_boards.php @@ -8,17 +8,27 @@ function stats_header() { global $ibforums; return << +
    -
    - - - - - - - - - - - - -EOF; -} - -function sent_screen($member_name) { -global $ibforums; -return << - - - -
    {$ibforums->lang['title']}
    {$ibforums->lang['in_forum']}{$data[FORUM]}->{'FORUM_NAME'}
    {$ibforums->lang['in_topic']}{$data[TOPIC]}->{'TOPIC_TITLE'}
    - - - - - - - - - - - - -
    {$ibforums->lang['email_sent']}
    {$ibforums->lang['email_sent']}
    {$ibforums->lang['email_sent_txt']} $member_name
    -
    -EOF; -} - -function guest() { -global $ibforums; -return << -
    {$ibforums->lang['name']}
    {$ibforums->lang['email']}
    +
    + + + +
    {$ibforums->lang['sm_forum_leaders']} | + {$ibforums->lang['sm_todays_posts']} | + {$ibforums->lang['sm_today_posters']} | + {$ibforums->lang['sm_all_posters']}
    +
    + + + + + + +
    - +
    + + + + + +
    - + EOF; } @@ -27,11 +37,11 @@ function ActiveUsers($active) { global $ibforums; return << - + - - + + EOF; } @@ -40,11 +50,11 @@ function ShowStats($text) { global $ibforums; return << - + - - + + EOF; } @@ -53,11 +63,26 @@ function birthdays($birthusers="", $total="", $birth_lang="") { global $ibforums; return << - + - - + + + +EOF; +} + + + +function calendar_events($events = "") { +global $ibforums; +return << + + + + + EOF; } @@ -92,26 +117,26 @@ EOF; function CatHeader_Expanded($Data) { global $ibforums; return << +
    {$ibforums->lang['board_stats']}{$ibforums->lang['board_stats']}
    $active[TOTAL] {$ibforums->lang['active_users']}$active[TOTAL] {$ibforums->lang['active_users']}
    {$ibforums->skin['F_ACTIVE']}{$active[GUESTS]} {$ibforums->lang['guests']}, $active[MEMBERS] {$ibforums->lang['public_members']} $active[ANON] {$ibforums->lang['anon_members']} {$active[LINK]}
    {$active[NAMES]}
    <{F_ACTIVE}>{$active[GUESTS]} {$ibforums->lang['guests']}, $active[MEMBERS] {$ibforums->lang['public_members']} $active[ANON] {$ibforums->lang['anon_members']} {$active[LINK]}
    {$active[NAMES]}
    {$ibforums->lang['board_stats']}{$ibforums->lang['board_stats']}
    {$ibforums->skin['F_STATS']}$text
    {$ibforums->lang['most_online']}
    <{F_STATS}>$text
    {$ibforums->lang['most_online']}
    {$ibforums->lang['birthday_header']}{$ibforums->lang['birthday_header']}
    {$ibforums->skin['F_ACTIVE']}$total $birth_lang
    $birthusers
    <{F_ACTIVE}>$total $birth_lang
    $birthusers
    {$ibforums->lang['calender_f_title']}
    <{F_ACTIVE}>$events
    - + + +
    - + - - - - - - + + + + + EOF; diff --git a/upload/Skin/s1/skin_buddy.php b/upload/Skin/s1/skin_buddy.php new file mode 100644 index 00000000..4e0c8e80 --- /dev/null +++ b/upload/Skin/s1/skin_buddy.php @@ -0,0 +1,222 @@ + + + + +EOF; +} + + +function build_away_msg() { +global $ibforums; +return <<lang['new_posts']} +
    + {$ibforums->lang['my_replies']} + +EOF; +} + +function append_view($url="") { +global $ibforums; +return <<{$ibforums->lang['view_link']} ) +EOF; +} + + +function main($away_text="") { +global $ibforums; +return << +
    + + + + + +
    + - - + +
    {$ibforums->skin['CAT_IMG']}{$Data['name']}<{CAT_IMG}>{$Data['name']}
    + - - - - - + + + + + EOF; } @@ -119,16 +144,17 @@ EOF; function subheader() { global $ibforums; return << +
    +
    {$ibforums->lang['cat_name']}{$ibforums->lang['topics']}{$ibforums->lang['replies']}{$ibforums->lang['last_post_info']}{$ibforums->lang['cat_name']}{$ibforums->lang['topics']}{$ibforums->lang['replies']}{$ibforums->lang['last_post_info']}
    - @@ -150,10 +176,7 @@ EOF; function end_all_cats() { global $ibforums; return << - - -
    + - - - - - + + + + + EOF; } @@ -137,7 +163,7 @@ function end_this_cat() { global $ibforums; return << - +
    {$ibforums->lang['cat_name']}{$ibforums->lang['topics']}{$ibforums->lang['replies']}{$ibforums->lang['last_post_info']}{$ibforums->lang['cat_name']}{$ibforums->lang['topics']}{$ibforums->lang['replies']}{$ibforums->lang['last_post_info']}
      
    --> + EOF; } @@ -167,17 +190,30 @@ EOF; function PageTop($lastvisit) { global $ibforums; return << + - + +
    {$ibforums->lang['welcome_back_text']} $lastvisit - {$ibforums->lang['sm_forum_leaders']} | - {$ibforums->lang['sm_todays_posts']}
    - {$ibforums->lang['sm_today_posters']} | - {$ibforums->lang['sm_all_posters']} +
     
    +EOF; +} + +function quick_log_in() { +global $ibforums; +return << + + + +
    {$ibforums->lang['qli_title']} + + +
    + EOF; } @@ -186,11 +222,11 @@ global $ibforums; return <<
    {$info['img_new_post']}{$info['name']}
    {$info['description']}
    {$info['moderator']}
    {$info['topics']}{$info['posts']}{$info['last_post']}
    {$ibforums->lang['in']}: {$info['last_topic']}
    {$ibforums->lang['by']}: {$info['last_poster']}
    {$info['img_new_post']}{$info['name']}
    {$info['description']}
    {$info['moderator']}
    {$info['topics']}{$info['posts']}{$info['last_post']}
    {$ibforums->lang['in']}: {$info['last_topic']}
    {$ibforums->lang['by']}: {$info['last_poster']}
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['page_title']}   [ -  + ]
    {$ibforums->lang['while_away']}
    $away_text
    {$ibforums->lang['show_me']}
    + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['sm_forum_leaders']}
    {$ibforums->lang['sm_todays_posts']}
    {$ibforums->lang['sm_today_posters']}
    {$ibforums->lang['sm_all_posters']}
    {$ibforums->lang['sm_my_last_posts']}
    +
    {$ibforums->lang['search_forums']}
     
    {$ibforums->lang['search_help']}
     
    +
    +
    + +
    +EOF; +} + + + +function login() { +global $ibforums; +return << + + + + + + + +
    + + + + +
    + + + + + + + + + + +
    {$ibforums->lang['page_title']}
    {$ibforums->lang['log_in_needed']}
    + {$ibforums->lang['no_guests']} +

    +
    + {$ibforums->lang['log_in']} +

    + {$ibforums->lang['lin_name']}
    +
    + {$ibforums->lang['lin_pass']}
    +
    + +
    +

    + {$ibforums->lang['reg_text']} +

    +
    {$ibforums->lang['reg_link']}
    +
    +
    +
    + +
    + + +EOF; +} + + +function closelink() { +global $ibforums; +return << +
    [ {$ibforums->lang['refresh']} ] | [ {$ibforums->lang['close_win']} ]
    + + +EOF; +} + +} +?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_calendar.php b/upload/Skin/s1/skin_calendar.php new file mode 100644 index 00000000..bb8c019c --- /dev/null +++ b/upload/Skin/s1/skin_calendar.php @@ -0,0 +1,274 @@ +<{P_EDIT}>
    +HTML; +} + + +function cal_show_event($event, $member, $event_type, $edit_button="") { +global $ibforums; + +return << +
      {$ibforums->lang['event_date']} {$event['mday']} {$event['month_text']} {$event['year']}  [ {$event['title']} ] ($event_type)
    + + + + + + + + +
    {$member['name']}

    {$member['avatar']}
    {$ibforums->lang['group']} {$member['g_title']}
    {$ibforums->lang['posts']} {$member['posts']}
    {$ibforums->lang['joined']} {$member['joined']}
    + $edit_button + + {$event['event_text']} + + +
    + + + + +
    + << {$ibforums->lang['back']} +
    +
    +
    +
    + +HTML; +} + +function cal_page_events_start() { +global $ibforums; + +return << + + + + +
    {$ibforums->lang['cal_title_events']}
    + +HTML; +} + +function cal_birthday_start() { +global $ibforums; + +return << +
    + + + + +
    {$ibforums->lang['cal_birthdays']}
    +
    + + +
    +
      + + +HTML; +} + +function cal_birthday_entry($uid, $uname, $age="") { +global $ibforums; + +return <<$uname ($age) +HTML; +} + + +function cal_birthday_end() { +global $ibforums; + +return << +
    + + +
    + + + + +
    + << input['m']}&y={$ibforums->input['y']}'>{$ibforums->lang['back']} +
    +
    +
    +HTML; +} + + + +function cal_main_content($month, $year, $prev, $next) { +global $ibforums; + +return << +
    + + + + +
    $month $year
    + + + + + + + + +
    + + + + + +
    {$ibforums->lang['table_title']} + < {$prev['month_name']} {$prev['year_id']} +    {$next['month_name']} {$next['year_id']} > +
    +
    + + + + + + + + + +
    + + + + + + +
    +     + {$ibforums->lang['post_new_event']} + < {$prev['month_name']} {$prev['year_id']} +    {$next['month_name']} {$next['year_id']} > +
    +
    +
    +
    + + + +HTML; +} + +function cal_day_bit($day) { +global $ibforums; + +return <<$day
    + + + +
    + + + + + + + + + + + + + + +
    {$ibforums->lang['report_title']}
    {$ibforums->lang['report_topic']}$topic_title +
    {$ibforums->lang['report_message']} +
    + +
    +
    + +EOF; +} + + +function msn_body($msnname) { +global $ibforums; +return << + + + {$ibforums->lang['msn_name']} + + + + {$ibforums->lang['msn_send_msg']} + + + {$ibforums->lang['msn_add_contact']} + + +EOF; +} + +function yahoo_body($yahoo) { +global $ibforums; +return << + {$ibforums->lang['yahoo_name']} + + + + {$ibforums->lang['yahoo_status']} + + + + {$ibforums->lang['yahoo_send_msg']} + + + {$ibforums->lang['yahoo_view_profile']} + + +EOF; +} + function icq_body($data) { global $ibforums; @@ -11,19 +88,19 @@ return << - {$ibforums->lang['name']} - + {$ibforums->lang['name']} + - {$ibforums->lang['email']} - + {$ibforums->lang['email']} + - {$ibforums->lang['msg']} - + {$ibforums->lang['msg']} + - + EOF; @@ -37,7 +114,7 @@ return << -   +   EOF; @@ -46,12 +123,12 @@ EOF; function pager_header($data) { global $ibforums; return << + \n \n \n\n', 'results', '$text', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n\n
    - + EOF; } @@ -75,36 +152,36 @@ return << -
    {$data[TITLE]}{$data[TITLE]}
    +
    \n \n
    - + - - + + - - + + - - + + - - + + - - + -
    {$ibforums->lang['title']}{$ibforums->lang['title']}
    {$ibforums->lang['send_lang']}$lang{$ibforums->lang['send_lang']}$lang
    {$ibforums->lang['to_name']}{$ibforums->lang['to_name']}
    {$ibforums->lang['to_email']}{$ibforums->lang['to_email']}
    {$ibforums->lang['subject']}{$ibforums->lang['subject']}
    {$ibforums->lang['message']} + {$ibforums->lang['message']}
    +
    @@ -118,17 +195,17 @@ EOF; function show_address($data) { global $ibforums; return << + @@ -145,28 +222,28 @@ return << -
    - + - + - +
    {$ibforums->lang['send_email_to']} {$data[NAME]}{$ibforums->lang['send_email_to']} {$data[NAME]}
    {$ibforums->lang['show_address_text']}{$ibforums->lang['show_address_text']}
    >>{$ibforums->lang['send_email_to']} {$data[NAME]}>>{$ibforums->lang['send_email_to']} {$data[NAME]}
    +
    - + EOF; @@ -20,7 +20,7 @@ global $ibforums; return << - + EOF; @@ -40,7 +40,7 @@ function no_results() { global $ibforums; return << - + EOF; } @@ -48,19 +48,19 @@ EOF; function start($one_text, $two_text, $three_text) { global $ibforums; return << +
    - + - + - - + - - + -
    {$ibforums->lang['send_title']}{$ibforums->lang['send_title']}
    {$ibforums->lang['send_email_to']} {$data[NAME]}{$ibforums->lang['send_email_to']} {$data[NAME]}
    {$ibforums->lang['subject']} + {$ibforums->lang['subject']}
    {$ibforums->lang['message']}

    {$ibforums->lang['msg_txt']}
    + {$ibforums->lang['message']}

    {$ibforums->lang['msg_txt']}
    +
    @@ -180,16 +257,16 @@ EOF; function sent_screen($member_name) { global $ibforums; return << + @@ -201,7 +278,7 @@ EOF; function forum_jump($data) { global $ibforums; return << +
    - + - +
    {$ibforums->lang['email_sent']}{$ibforums->lang['email_sent']}
    {$ibforums->lang['email_sent_txt']} $member_name{$ibforums->lang['email_sent_txt']} $member_name
    diff --git a/upload/Skin/s1/skin_forum.php b/upload/Skin/s1/skin_forum.php index d7fb24f5..d17357f9 100644 --- a/upload/Skin/s1/skin_forum.php +++ b/upload/Skin/s1/skin_forum.php @@ -12,22 +12,22 @@ return << -
    $data
    +
    @@ -37,24 +37,13 @@ return << -
    - + - + - - + + - +
    {$ibforums->lang['need_password']}{$ibforums->lang['need_password']}
    {$ibforums->lang['need_password_txt']}{$ibforums->lang['need_password_txt']}
    {$ibforums->lang['enter_pass']}{$ibforums->lang['enter_pass']}
    - - - -
    vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$data'>{$ibforums->lang['mod_cp']}
    -EOF; -} function show_rules_full($rules) { global $ibforums; return <<
    - +
    @@ -69,7 +58,7 @@ global $ibforums; return <<
    -
    {$rules['title']}

    {$rules['body']}
    +
    @@ -79,6 +68,14 @@ return <<{$ibforums->lang['ft_title']} +EOF; +} + function TableEnd($Data) { global $ibforums; return << - + + + + + +
    >>vars['php_ext']}?s={$ibforums->session_id}&act=SR&f={$rules['fid']}'>{$rules['title']}
    + + - + + + +
    + @@ -103,17 +101,17 @@ return <<
    {$ibforums->lang['showing_text']}{$ibforums->lang['sort_text']}
    - +
    - +
    {$Data[SHOW_PAGES]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$Data['id']}'>{$ibforums->skin['A_POST']}{$Data[POLL_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$Data['id']}'><{A_POST}>{$Data[POLL_BUTTON]}
    - +
    - + - + + + + +
    {$ibforums->skin['B_NEW']}<{B_NEW}> {$ibforums->lang['pm_open_new']} {$ibforums->skin['B_POLL']}<{B_POLL}> {$ibforums->lang['pm_poll']}  @@ -134,21 +132,21 @@ return << - + - + - + - + - + - +
    {$ibforums->skin['B_NORM']}<{B_NORM}> {$ibforums->lang['pm_open_no']} {$ibforums->skin['B_POLL_NN']}<{B_POLL_NN}> {$ibforums->lang['pm_poll_no']} 
    {$ibforums->skin['B_HOT']}<{B_HOT}> {$ibforums->lang['pm_hot_new']} {$ibforums->skin['B_LOCKED']}<{B_LOCKED}> {$ibforums->lang['pm_locked']} 
    {$ibforums->skin['B_HOT_NN']}<{B_HOT_NN}> {$ibforums->lang['pm_hot_no']} {$ibforums->skin['B_MOVED']}<{B_MOVED}> {$ibforums->lang['pm_moved']} 
    @@ -160,18 +158,18 @@ global $ibforums; return <<
    - +
    @@ -185,9 +183,9 @@ EOF; function page_title($title="", $pages="") { global $ibforums; return << +
    - + - + - +
    {$rules['title']}{$rules['title']}
    {$rules['body']}{$rules['body']}
    >>{$ibforums->lang['back_to_forum']}>>{$ibforums->lang['back_to_forum']}
    - +
    $title$pages$title$pages
    EOF; @@ -197,52 +195,86 @@ function PageTop($info) { global $ibforums; return << - + + + + + +
    - +
    {$info['SHOW_PAGES']}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$info['id']}'>{$ibforums->skin['A_POST']}{$info[POLL_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$info['id']}'><{A_POST}>{$info[POLL_BUTTON]}
    - +
    + vars['php_ext']}?s={$ibforums->session_id}' method='POST'> - - - - - - -
    - + + - - - -
    + - + +
    {$info['name']}{$info['name']}[ {$ibforums->lang['mark_as_read']} ]
    -
    - + - - - + + - - - - + {$Data['description']} + + + + EOF; } +function render_pinned_start() { +global $ibforums; +return << + + + + + +EOF; +} + +function render_pinned_end() { +global $ibforums; +return << + + + + + +EOF; +} + + +function render_pinned_row($Data) { +global $ibforums; +return << + + + + + + + + + + +EOF; +} + } ?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_global.php b/upload/Skin/s1/skin_global.php index 2fbf0f4e..10e9d3e9 100644 --- a/upload/Skin/s1/skin_global.php +++ b/upload/Skin/s1/skin_global.php @@ -1,273 +1,322 @@ -lang['logged_in_as']} {$ibforums->member['name']} ( vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=00'>{$ibforums->lang['your_cp']} | vars['php_ext']}?s={$ibforums->session_id}&act=Login&CODE=03'>{$ibforums->lang['log_out']} | vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=01'>{$msg[TEXT]} ) -EOF; -} - -function BoardHeader($time="") { -global $ibforums; -return << - - - - - - - -
    + - - - - - - - + + + + + + + EOF; } + +function forum_active_users($active=array()) { +global $ibforums; +return << + + + + + + +
    - + + - {$ibforums->lang['h_topic_title']} ( vars['php_ext']}?s={$ibforums->session_id}&act=Login&CODE=04&f={$info['id']}'>{$ibforums->lang['mark_as_read']} ){$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}{$ibforums->lang['h_topic_title']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}
    {$ibforums->lang['active_users_title']} ({$ibforums->lang['active_users_detail']})
    {$ibforums->lang['active_users_members']} {$active['names']}
    + + +EOF; +} + + + function show_no_matches() { global $ibforums; return << -
    +
    {$ibforums->lang['no_topics']}

    @@ -251,30 +283,87 @@ return <<$posts +EOF; +} + function RenderRow($Data) { global $ibforums; return <<
    {$Data['folder_img']}{$Data['topic_icon']} + {$Data['folder_img']}{$Data['topic_icon']} - +
    {$Data['go_new_post']}{$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&s={$ibforums->session_id}' id='linkthru' title='{$ibforums->lang['topic_started_on']} {$Data['start_date']}'>{$Data['title']} {$Data[PAGES]}{$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&s={$ibforums->session_id}' class='linkthru' title='{$ibforums->lang['topic_started_on']} {$Data['start_date']}'>{$Data['title']} {$Data[PAGES]}
    - {$Data['description']}
    {$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$Data['forum_id']}&t={$Data['tid']}&view=getlastpost'>{$Data['last_text']} {$Data['last_poster']}
    {$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$Data['forum_id']}&t={$Data['tid']}&view=getlastpost'>{$Data['last_text']} {$Data['last_poster']}
      {$ibforums->lang['pinned_start']}
      {$ibforums->lang['regular_topics']}
    {$Data['folder_img']}{$Data['topic_icon']} + + + + + +
    {$Data['go_new_post']}{$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&s={$ibforums->session_id}' class='linkthru' title='{$ibforums->lang['topic_started_on']} {$Data['start_date']}'>{$Data['title']} {$Data[PAGES]}
    + {$Data['description']}
    {$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$Data['forum_id']}&t={$Data['tid']}&view=getlastpost'>{$Data['last_text']} {$Data['last_poster']}
    Powered by IBForums
    - - - - - -
    - <% MEMBER BAR %> - vars['php_ext']}?s={$ibforums->session_id}&act=Search&f={$ibforums->input['f']}' style='text-decoration:none'> Search | vars['php_ext']}?s={$ibforums->session_id}&act=Members' style='text-decoration:none'> Member List | vars['php_ext']}?s={$ibforums->session_id}&act=Help' style='text-decoration:none'> Help
    -
    -
    -EOF; -} - -function start_nav() { -global $ibforums; -return << -
    {$ibforums->skin['F_NAV']}
    -EOF; -} - -function Redirect($Text, $Url) { -global $ibforums; -return << - -{$ibforums->lang['stand_by']} -vars['php_ext']}$Url'> - - - - - - - - -
    - - - - -
    - - - - -
    - {$ibforums->lang['thanks']}, - $Text

    - {$ibforums->lang['transfer_you']}

    - (vars['php_ext']}$Url'>{$ibforums->lang['dont_wait']})
    -
    -
    - - -EOF; -} - -function PM_popup() { -global $ibforums; -return << - - -EOF; -} - -function Guest_bar() { -global $ibforums; -return <<lang['guest_stuff']} ( vars['php_ext']}?s={$ibforums->session_id}&act=Login&CODE=00'>{$ibforums->lang['log_in']} | vars['php_ext']}?s={$ibforums->session_id}&act=Reg&CODE=00'>{$ibforums->lang['register']} ) -EOF; -} - -function admin_link() { -global $ibforums; -return <<vars['php_ext']}' target='_blank'>{$ibforums->lang['admin_cp']} ) -EOF; -} - -function error_log_in($q_string) { -global $ibforums; -return <<vars['php_ext']}' method='post'> - - - - - - - - - -
    - - - - - - - - - - - - - - -
    {$ibforums->lang['er_log_in_title']}
    {$ibforums->lang['erl_enter_name']}
    {$ibforums->lang['erl_enter_pass']}
    - -
    -
    - -EOF; -} - -function board_offline($message = "") { -global $ibforums; -return << -
    - - - - - -
    {$ibforums->lang['offline_title']}
    -
    - - - - - - - - - vars['php_ext']}' method='post'> - - - - - - - - - - - - - - - - -

    $message

    {$ibforums->lang['offline_login']}
    {$ibforums->lang['erl_enter_name']}
    {$ibforums->lang['erl_enter_pass']}
    -EOF; -} - -function Error($message, $ad_email_one="", $ad_email_two="") { -global $ibforums; -return << - - - - - - - - - - -
    - - - - - -
    {$ibforums->lang['error_title']}
    -
    - - - - - - - -
    - {$ibforums->lang['exp_text']}

    - {$ibforums->lang['msg_head']} -

    - $message -

    - -

    - Useful Links: -

    - • {$ibforums->lang['er_lost_pass']}
    - • {$ibforums->lang['er_register']}
    - • {$ibforums->lang['er_help_files']}
    - • {$ibforums->lang['er_contact_admin']}

    -
    < {$ibforums->lang['error_back']}
    -
    -EOF; -} - -function Member_no_usepm_bar() { -global $ibforums; -return <<lang['logged_in_as']} {$ibforums->member['name']} ( vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=00'>{$ibforums->lang['your_cp']} | vars['php_ext']}?s={$ibforums->session_id}&act=Login&CODE=03'>{$ibforums->lang['log_out']} ) -EOF; -} - - -} + +
    {$ibforums->lang['logged_in_as']} {$ibforums->member['name']} ( {$ibforums->lang['log_out']}$ad_link $mod_link ) + {$ibforums->lang['your_cp']} | {$msg[TEXT]} + | {$ibforums->lang['view_new_posts']} | {$ibforums->lang['l_qb']} +
    +EOF; +} + +function ibf_banner() { +global $ibforums; +return <<IPS Hosting +EOF; +} + +function BoardHeader($time="") { +global $ibforums; +return << + + + + + + + + + + + +
    + + + + + +
    Powered by Invision Board
    +
    + + + + +
    <% MEMBER BAR %> +
    +
    +
    +EOF; +} + + +function start_nav() { +global $ibforums; +return << +
    <{F_NAV}> + + + + +
    {$ibforums->lang['tb_help']} + | {$ibforums->lang['tb_search']} + | {$ibforums->lang['tb_mlist']} + | {$ibforums->lang['tb_calendar']} +
    + +
    +
    +EOF; +} + +function Redirect($Text, $Url, $css) { +global $ibforums; +return << + +{$ibforums->lang['stand_by']} +vars['php_ext']}$Url'> +$css + + + + + + +
    + + + + +
    + + + + +
    + {$ibforums->lang['thanks']}, + $Text

    + {$ibforums->lang['transfer_you']}

    + (vars['php_ext']}$Url'>{$ibforums->lang['dont_wait']})
    +
    +
    + + +EOF; +} + +function PM_popup() { +global $ibforums; +return << + + +EOF; +} + +function Guest_bar() { +global $ibforums; +return <<lang['guest_stuff']} ( {$ibforums->lang['log_in']} | {$ibforums->lang['register']} ) +EOF; +} + +function admin_link() { +global $ibforums; +return <<vars['php_ext']}' target='_blank'>{$ibforums->lang['admin_cp']} +EOF; +} + +function mod_link() { +global $ibforums; +return <<{$ibforums->lang['mod_cp']} +EOF; +} + +function error_log_in($q_string) { +global $ibforums; +return <<vars['php_ext']}' method='post'> + + + + + + + + + +
    + + + + + + + + + + + + + + +
    {$ibforums->lang['er_log_in_title']}
    {$ibforums->lang['erl_enter_name']}
    {$ibforums->lang['erl_enter_pass']}
    + +
    +
    + +EOF; +} + +function board_offline($message = "") { +global $ibforums; +return << +
    + + + + + +
    {$ibforums->lang['offline_title']}
    +
    + + + + + + + + + vars['php_ext']}' method='post'> + + + + + + + + + + + + + + + + +

    $message

    {$ibforums->lang['offline_login']}
    {$ibforums->lang['erl_enter_name']}
    {$ibforums->lang['erl_enter_pass']}
    +EOF; +} + +function Error($message, $ad_email_one="", $ad_email_two="") { +global $ibforums; +return << + + + + + + + + + + +
    + + + + + +
    {$ibforums->lang['error_title']}
    +
    + + + + + + + +
    + {$ibforums->lang['exp_text']}

    + {$ibforums->lang['msg_head']} +

    + $message +

    + +

    + Useful Links: +

    + • {$ibforums->lang['er_lost_pass']}
    + • {$ibforums->lang['er_register']}
    + • {$ibforums->lang['er_help_files']}
    + • {$ibforums->lang['er_contact_admin']}

    +
    < {$ibforums->lang['error_back']}
    +
    +EOF; +} + +function Member_no_usepm_bar() { +global $ibforums; +return <<lang['logged_in_as']} {$ibforums->member['name']} ( {$ibforums->lang['your_cp']} | {$ibforums->lang['log_out']} ) +EOF; +} + + +} ?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_help.php b/upload/Skin/s1/skin_help.php index 1ac7583c..4b628ddb 100644 --- a/upload/Skin/s1/skin_help.php +++ b/upload/Skin/s1/skin_help.php @@ -9,7 +9,7 @@ global $ibforums; return <<
    vars['php_ext']}?act=Help&s={$ibforums->session_id}&CODE=01&HID={$entry['id']}'>{$entry['title']}
    {$entry['description']}
    vars['php_ext']}?act=Help&s={$ibforums->session_id}&CODE=01&HID={$entry['id']}'>{$entry['title']}
    {$entry['description']}
    $text$text
    {$ibforums->lang['no_results']}{$ibforums->lang['no_results']}
    $two_text
    - +
    \n \n \n \n \n \n \n \n \n \n \n \n\n\n', 'merge_body', '$title="", $desc=""', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n
    - + -
    $one_text$one_text
    +
    @@ -74,12 +74,12 @@ return <<

    - +
    + + +EOF; +} + +function move_checked_form_start($forum_name, $fid) { +global $ibforums; +return << +
    - + EOF; } diff --git a/upload/Skin/s1/skin_legends.php b/upload/Skin/s1/skin_legends.php index 098a1ce2..eb23d681 100644 --- a/upload/Skin/s1/skin_legends.php +++ b/upload/Skin/s1/skin_legends.php @@ -3,6 +3,143 @@ class skin_legends { +function find_user_one($entry="", $name="", $sep="comma") { +global $ibforums; +return << +
    $three_text$three_text
    + + + + + + + + + +
    {$ibforums->lang['fu_title']}
    {$ibforums->lang['fu_enter_name']}



    {$ibforums->lang['fu_close_win']}
    + + +EOF; +} + + +function find_user_error($msg) { +global $ibforums; +return << + + + + + + + + + + +
    {$ibforums->lang['fu_error']}
    $msg
    {$ibforums->lang['fu_back']} :: {$ibforums->lang['fu_close_win']}
    + + +EOF; +} + + +function find_user_final($names="",$entry="", $name="", $sep="line") { +global $ibforums; +return << + + + +
    + + + + + + + + + + +
    {$ibforums->lang['fu_title']}
    {$ibforums->lang['fu_add_desc']}



    {$ibforums->lang['fu_back']} :: {$ibforums->lang['fu_close_win']}
    +
    + +EOF; +} + + + function emoticon_javascript() { return << + + +
    - + - - + + @@ -45,8 +182,8 @@ global $ibforums; return << - - + + diff --git a/upload/Skin/s1/skin_login.php b/upload/Skin/s1/skin_login.php index bba4048d..501c0ce1 100644 --- a/upload/Skin/s1/skin_login.php +++ b/upload/Skin/s1/skin_login.php @@ -12,18 +12,18 @@ return << -
    $title$title
    $row1$row2$row1$row2
    $code$image$code$image
    +
    - + - + -
    {$ibforums->lang['log_out']}{$ibforums->lang['log_out']}

    {$ibforums->lang['log_out_txt']}

    {$ibforums->lang['log_out_txt']}
    +
    @@ -34,12 +34,12 @@ EOF; function errors($data) { global $ibforums; return << + @@ -49,7 +49,7 @@ return << @@ -70,7 +70,7 @@ return <<
    -
    - +
    {$ibforums->lang['errors_found']}
    $data
    {$ibforums->lang['errors_found']}
    $data
    +
    @@ -78,48 +78,45 @@ return <<{$ibforums->lang['forgot_pass']} vars['php_ext']}?act=Reg&CODE=10'>{$ibforums->lang['pass_link']}
    {$ibforums->lang['login_text']}
    -
    - - - - - + + +
    - + - - + + - - + +
    $message$message
    {$ibforums->lang['enter_name']}{$ibforums->lang['enter_name']}
    {$ibforums->lang['enter_pass']}{$ibforums->lang['enter_pass']}

    - +
    - + - - + + - - + + -
    {$ibforums->lang['options']}{$ibforums->lang['options']}
    {$ibforums->lang['cookies']}{$ibforums->lang['cookie_yes']}
    {$ibforums->lang['cookie_no']}
    {$ibforums->lang['cookies']}{$ibforums->lang['cookie_yes']}
    {$ibforums->lang['cookie_no']}
    {$ibforums->lang['privacy']}{$ibforums->lang['anon_name']}{$ibforums->lang['privacy']}{$ibforums->lang['anon_name']}
    +
    diff --git a/upload/Skin/s1/skin_mlist.php b/upload/Skin/s1/skin_mlist.php index 6ac42971..3c2b86c3 100644 --- a/upload/Skin/s1/skin_mlist.php +++ b/upload/Skin/s1/skin_mlist.php @@ -27,29 +27,29 @@ return << - +
    {$links[SHOW_PAGES]}
    - +
    - - + + + + + +
    +  
    + - - - - - - - - + + + + + + + + EOF; } @@ -57,7 +57,7 @@ EOF; function end($links) { global $ibforums; return << +
    {$ibforums->lang['member_name']}{$ibforums->lang['member_level']}{$ibforums->lang['member_group']}{$ibforums->lang['member_joined']}{$ibforums->lang['member_posts']}{$ibforums->lang['member_email']}{$ibforums->lang['member_aol']}{$ibforums->lang['member_icq']}{$ibforums->lang['member_name']}{$ibforums->lang['member_level']}{$ibforums->lang['member_group']}{$ibforums->lang['member_joined']}{$ibforums->lang['member_posts']}{$ibforums->lang['member_email']}{$ibforums->lang['member_aol']}{$ibforums->lang['member_icq']}
    @@ -88,7 +88,13 @@ return << - + @@ -104,14 +110,14 @@ global $ibforums; return << - - - - - - - - + + + + + + + + EOF; diff --git a/upload/Skin/s1/skin_mod.php b/upload/Skin/s1/skin_mod.php index 9904f458..f981c667 100644 --- a/upload/Skin/s1/skin_mod.php +++ b/upload/Skin/s1/skin_mod.php @@ -16,17 +16,17 @@ return << + + + + + + + + +EOF; +} + +function forum_page_start() { +global $ibforums; +return << +
    {$links[SHOW_PAGES]}
    {$ibforums->lang['sorting_text']}  +   
    + {$ibforums->lang['sorting_text']} 
    {$member[MEMBER_NAME]}{$member[MEMBER_PIPS_IMG]}{$member[MEMBER_GROUP]}{$member[MEMBER_JOINED]}{$member[MEMBER_POSTS]}{$member[MEMBER_EMAIL]}{$member[AOLNAME]}{$member[ICQNUMBER]}{$member[MEMBER_NAME]}{$member[MEMBER_PIPS_IMG]}{$member[MEMBER_GROUP]}{$member[MEMBER_JOINED]}{$member[MEMBER_POSTS]}{$member[MEMBER_EMAIL]}{$member[AOLNAME]}{$member[ICQNUMBER]}
    - +
    -
    {$ibforums->lang['cp_mod_posts_title2']} $forumname + {$ibforums->lang['cp_mod_posts_title2']} $forumname
    $pages
    - +
    - + EOF; @@ -39,19 +39,19 @@ return << + + +
    $title$title
    - +
    - + + + +EOF; +} + + +function mod_postentry($data) { +global $ibforums; +return << + + + + + +EOF; +} + +function mod_postentry_checkbox($pid) { +global $ibforums; +return << + + + +EOF; +} + + +function mod_topic_spacer() { +global $ibforums; +return << +
    + +EOF; +} + +function results($text) { +global $ibforums; +return << +
    + + +EOF; +} + + +function prune_confirm($tcount, $count, $link, $link_text) { +global $ibforums; +return << + + + +
    {$ibforums->lang['cp_mod_posts_title2']} $forumname + {$ibforums->lang['cp_mod_posts_title2']} $forumname
    - +
    - - - - + + + + EOF; @@ -62,10 +62,10 @@ global $ibforums; return << - - - - + + + + EOF; @@ -99,9 +99,9 @@ return << @@ -131,9 +131,9 @@ return << + + +
    {$ibforums->lang['cp_3_title']}{$ibforums->lang['cp_3_replies']}{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}{$ibforums->lang['cp_3_title']}{$ibforums->lang['cp_3_replies']}{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}
    $title$replies{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}$title$replies{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}
    - +
    - @@ -114,7 +114,7 @@ global $ibforums; return << - +
    {$ibforums->lang['cp_mod_topics_title2']} $forumname + {$ibforums->lang['cp_mod_topics_title2']} $forumname
    $pages
      {$ibforums->lang['cp_1_selected']}    {$ibforums->lang['cp_1_selected']}  
    - +
    - + EOF; @@ -145,10 +145,10 @@ global $ibforums; return << - - + @@ -163,7 +163,7 @@ global $ibforums; return << - + EOF; @@ -192,9 +192,9 @@ return << - + + - - + - + + - - + + @@ -521,8 +521,8 @@ global $ibforums; return << - - + + EOF; @@ -536,8 +536,8 @@ global $ibforums; return << - - + + EOF; @@ -548,13 +548,13 @@ EOF; function table_top($posting_title) { global $ibforums; return << +
    +
       $title   $title
    {$data['member']['name']}

    {$data['member']['avatar']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    + {$data['member']['name']}

    {$data['member']['avatar']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    {$ibforums->lang['posted_on']} {$data['msg']['post_date']}

    - + {$data['msg']['post']}
      {$ibforums->lang['cp_3_postno']} $pid  {$ibforums->lang['cp_3_postno']} $pid
    - +
    - @@ -214,9 +214,9 @@ return << @@ -252,15 +252,15 @@ return << - + - - + + @@ -304,7 +304,7 @@ return << - + @@ -350,7 +350,7 @@ return << - + @@ -375,7 +375,7 @@ return << - + @@ -395,14 +395,14 @@ global $ibforums; return << - +
    {$ibforums->lang['cp_results']} + {$ibforums->lang['cp_results']}
    - +
    - @@ -229,7 +229,7 @@ return <<$count - +
    {$ibforums->lang['cp_check_result']} + {$ibforums->lang['cp_check_result']}
    {$ibforums->lang['cp_check_text']}
    $link_text$link_text
    {$ibforums->lang['cp_prune']} {$forum['name']}{$ibforums->lang['cp_prune']} {$forum['name']}
    {$ibforums->lang['cp_prune_text']}
    {$ibforums->lang['cp_action']}{$ibforums->lang['cp_action']}
    {$ibforums->lang['cp_edit_user']}: {$profile['name']}{$ibforums->lang['cp_edit_user']}: {$profile['name']}
    {$ibforums->lang['cp_remove_av']}
    {$ibforums->lang['cp_edit_user']}{$ibforums->lang['cp_edit_user']}
    {$ibforums->lang['cp_find_2_user']}
    {$ibforums->lang['cp_edit_user']}{$ibforums->lang['cp_edit_user']}
    {$ibforums->lang['cp_find_user']}{$ibforums->lang['cp_welcome']}{$ibforums->lang['cp_welcome']}
    {$ibforums->lang['cp_welcome_text']}
    - +
    @@ -435,7 +435,7 @@ return << - + @@ -448,7 +448,7 @@ return << -
    {$ibforums->lang['cp_mod_in']} $forum$words$words
    +
    @@ -464,12 +464,12 @@ return << -
    {$ibforums->lang[move_from]} $forum_name {$ibforums->lang[to]}:{$ibforums->lang[move_from]} $forum_name {$ibforums->lang[to]}:
    {$ibforums->lang['leave_link']} + {$ibforums->lang['leave_link']} {$ibforums->lang[edit_f_title]}{$ibforums->lang[edit_f_title]}
    {$ibforums->lang[edit_f_desc]}{$ibforums->lang[edit_f_desc]}
    {$ibforums->lang['pe_option']} $id{$ibforums->lang['pe_option']} $id
    {$ibforums->lang['pe_pollonly']} $id{$ibforums->lang['pe_pollonly']} $id
    + + + + + + + + + + + EOF; } diff --git a/upload/Skin/s1/skin_modcp.php b/upload/Skin/s1/skin_modcp.php new file mode 100644 index 00000000..3e1d9b74 --- /dev/null +++ b/upload/Skin/s1/skin_modcp.php @@ -0,0 +1,880 @@ +" align="center" border="0" cellspacing="1" cellpadding="0"> + + + + + + +
    - + @@ -562,13 +562,116 @@ EOF; } +function topic_history($data) { +global $ibforums; +return << +
    $posting_title$posting_title
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['th_title']}
    {$ibforums->lang['th_topic']}{$data['th_topic']}
    {$ibforums->lang['th_desc']}{$data['th_desc']}
    {$ibforums->lang['th_start_date']}{$data['th_start_date']}
    {$ibforums->lang['th_start_name']}{$data['th_start_name']}
    {$ibforums->lang['th_last_date']}{$data['th_last_date']}
    {$ibforums->lang['th_last_name']}{$data['th_last_name']}
    {$ibforums->lang['th_avg_post']}{$data['th_avg_post']}
    +
    +EOF; +} + +function mod_log_start() { +global $ibforums; +return << + + + + + + + + + + + + + + + +
    + + + + + + + + + + +EOF; + +} + +function mod_log_none() { +global $ibforums; +return << + + + +EOF; + +} + +function mod_log_row($data) { +global $ibforums; +return << + + + + + +EOF; + +} + +function mod_log_end() { +global $ibforums; +return << + + +
    {$ibforums->lang['ml_title']}
    {$ibforums->lang['ml_name']}{$ibforums->lang['ml_desc']}{$ibforums->lang['ml_date']}
    {$data['ml_none']}
    {$data['member']}{$data['action']}{$data['date']}
    + +EOF; + +} + function forum_jump($data, $menu_extra="") { global $ibforums; return << - +
    @@ -578,96 +681,88 @@ EOF; } -function Menu_bar($base_url, $fid) { + + +function split_body($jump="") { global $ibforums; return << -
    {$data}
    - -
    - - - - - - - - -
      
    - - - - - - - - - - - - -
    {$ibforums->lang['cp_mod_topics_title']}
    {$ibforums->lang['cp_mod_topics']}
    {$ibforums->lang['cp_mod_posts']}
    - - - -
    - - - - - - - - -
    {$ibforums->lang['cp_manage_posts']}
    {$ibforums->lang['cp_prune_posts']}
    - - - -
    - - - - - - - - -
    {$ibforums->lang['cp_mod_users_title']}
    {$ibforums->lang['cp_user_edit']}
    - -
    - - - - - -EOF; -} - - -function CP_end() { -global $ibforums; -return << -
    -
    +
    {$ibforums->lang['mt_new_title']}
    {$ibforums->lang['mt_new_desc']}
    {$ibforums->lang['st_forum']}
    + + + + EOF; } -function mod_error($msg="") { +function split_row($row) { global $ibforums; return << - - - - - + + + + + +EOF; +} + + +function split_end_form($action) { +global $ibforums; +return << + + +
    {$ibforums->lang['st_post']}
    {$ibforums->lang['cp_error']}
    $msg
    {$row['st_top_bit']} +
    +
    {$row['post']} +
    {$ibforums->lang['st_split']}  
    +
    + +
    +
    + + + +EOF; +} + +function merge_body($title="", $desc="") { +global $ibforums; +return << +
    {$ibforums->lang['mt_new_title']}
    {$ibforums->lang['mt_new_desc']}
    {$ibforums->lang['mt_tid']}
    {$ibforums->lang['cp_modcp_ptitle']}
    {$ibforums->lang['mod_opts']}: + {$ibforums->lang['menu_forums']} | + {$ibforums->lang['menu_users']} | + {$ibforums->lang['menu_ip']}
    +
    +EOF; +} + + +function modtopicview_start($tid,$forumname, $fid, $title) { +global $ibforums; +return << + + + + + + + + + + +
    {$ibforums->lang['cp_mod_posts_title2']} $forumname +
    $pages +
    + + + + + +EOF; +} + + +function modpost_topicstart($forumname, $fid) { +global $ibforums; +return << + + + +
    $title
    {$ibforums->lang['cp_mod_posts_title2']} $forumname +
    + + + + + + + + +EOF; +} + +function modpost_topicentry($title, $tid, $replies, $fid) { +global $ibforums; +return << + + + + + + +EOF; +} + +function modpost_topicend() { +global $ibforums; +return << + + +
    {$ibforums->lang['cp_3_title']}{$ibforums->lang['cp_3_replies']}{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}
    $title$replies{$ibforums->lang['cp_3_approveall']}{$ibforums->lang['cp_3_viewall']}
    + +EOF; +} + + + +function modtopics_start($pages,$forumname, $fid) { +global $ibforums; +return << + + + + + + + + + +
    {$ibforums->lang['cp_mod_topics_title2']} $forumname +
    $pages +
    + +EOF; +} + +function modtopics_end() { +global $ibforums; +return << +
    + + +EOF; +} + + +function mod_topic_title($title, $topic_id) { +global $ibforums; +return << +
       $title
    {$data['member']['name']}

    {$data['member']['avatar']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    + {$ibforums->lang['posted_on']} {$data['msg']['post_date']}

    + + {$data['msg']['post']} + +
      {$ibforums->lang['cp_3_postno']} $pid
    + + + + + + + +
    {$ibforums->lang['cp_results']} +
    $text
    +
    + + + + + + + + + + + + + + + +
    {$ibforums->lang['cp_check_result']} +
    {$ibforums->lang['cp_check_text']} +
    {$ibforums->lang['cp_total_topics']}$tcount
    {$ibforums->lang['cp_total_match']}$count
    $link_text
    +
    +
    + +EOF; +} + +function prune_splash($forum, $forums, $select) { +global $ibforums; +return << + + + + + + + + + + + + + + + +
    {$ibforums->lang['cp_prune']} {$forum['name']}
    {$ibforums->lang['cp_prune_text']}
    + +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['cp_action']}
    {$ibforums->lang['cp_prune_days']}
    {$ibforums->lang['cp_prune_type']}$select
    {$ibforums->lang['cp_prune_replies']}
    {$ibforums->lang['cp_prune_member']}
    +
    + + +EOF; +} + + + + +function edit_user_form($profile) { +global $ibforums; +return << + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['cp_edit_user']}: {$profile['name']}
    {$ibforums->lang['cp_remove_av']}
    {$ibforums->lang['cp_edit_website']}
    {$ibforums->lang['cp_edit_location']}
    {$ibforums->lang['cp_edit_interests']}
    {$ibforums->lang['cp_edit_signature']}
    +
    + + +EOF; +} + + +function find_two($select) { +global $ibforums; +return << + + + + + + + +
    + + + + + + + + + + + +
    {$ibforums->lang['cp_edit_user']}
    {$ibforums->lang['cp_find_2_user']}$select
    +
    + + +EOF; +} + + +function find_user() { +global $ibforums; +return << + + + + + + + +
    + + + + + + + + + + + +
    {$ibforums->lang['cp_edit_user']}
    {$ibforums->lang['cp_find_user']}
    +
    + + +EOF; +} + +function ip_start_form($ip_addr) { +global $ibforums; +return << + + + + + + + +
    {$ibforums->lang['ip_desc_text']}

    {$ibforums->lang['ip_warn_text']}
    +
    + + + + +
    + + + + + + + + + + + +
    {$ibforums->lang['menu_ip']}
    {$ibforums->lang['ip_enter']} + . + . + . +   + +
    +
    + + +EOF; +} + +function ip_member_start($pages) { +global $ibforums; +return << +
    $pages
    +
    + + + + + + + + + + + +EOF; +} + + + + + + + +function mod_exp($words) { +global $ibforums; +return << + + + + +EOF; +} + +function end_form($action) { +global $ibforums; +return << +
    + + + + + + + + + + + + +EOF; +} + +function ip_member_row($row) { +global $ibforums; +return << + + + + + + + +EOF; +} + +function ip_member_end($pages) { +global $ibforums; +return << + + +
    {$ibforums->lang['ipm_title']}
    {$ibforums->lang['ipm_name']}{$ibforums->lang['ipm_ip']}{$ibforums->lang['ipm_posts']}{$ibforums->lang['ipm_reg']}{$ibforums->lang['ipm_options']}
    {$row['name']}{$row['ip_address']}{$row['posts']}{$row['joined']}{$ibforums->lang['ipm_view']} + | {$ibforums->lang['ipm_edit']}
    + + + + +
    $pages
    + +EOF; +} + +function splash($tcount, $pcount, $forum) { +global $ibforums; +return << +
    {$ibforums->lang['cp_welcome']}
    {$ibforums->lang['cp_welcome_text']}
    + + + + + + + + + + + + + +
    {$ibforums->lang['cp_mod_in']}$forum
    {$ibforums->lang['cp_topics_wait']}$tcount
    {$ibforums->lang['cp_posts_wait']}$pcount
    +
    $words
    + +
    +
    + + + +EOF; +} + +function forum_row($info) { +global $ibforums; +return << +
    {$info['folder_icon']}{$info['name']}
    {$info['description']}
    {$info['moderator']}
    {$info['q_topics']}{$info['q_posts']}{$info['last_post']}
    {$ibforums->lang['in']}: {$info['last_topic']}
    {$ibforums->lang['by']}: {$info['last_poster']}
    + + + +
    + +EOF; +} + + +function cat_row($cat_name) { +global $ibforums; +return << + + + + + + + + + + +EOF; +} + +function forum_page_end() { +global $ibforums; +return << + + +
    $cat_name
     {$ibforums->lang['cat_name']}{$ibforums->lang['f_q_topics']}{$ibforums->lang['f_q_posts']}{$ibforums->lang['last_post_info']}{$ibforums->lang['f_select']}
    {$ibforums->lang['f_w_selected']} +   +
    +
    + +EOF; +} + +function mod_simple_page($title="",$msg="") { +global $ibforums; +return << +
    $title
    $msg
    + +EOF; +} + +function ip_post_results($uid="",$count="") { +global $ibforums; +return <<lang['ipp_found']} $count +
    +
    +{$ibforums->lang['ipp_click']} + +EOF; +} + +function start_topics($pages,$info) { +global $ibforums; +return << + + + + + + + +
    $pages
    + + + + + + + + + + + +
    + + + + + +
    {$info['name']} [ {$ibforums->lang['new_show_forum']} ]
    +
    + + + + + + + + + + + + +EOF; +} + +function show_no_topics() { +global $ibforums; +return << + + +EOF; +} + +function topic_row($Data) { +global $ibforums; +return << + + + + + + + + + + + +EOF; +} + +function topics_end($Data) { +global $ibforums; +return << + + + + + + +
    {$ibforums->lang['h_topic_title']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}{$ibforums->lang['f_select']}
    +
    + {$ibforums->lang['fv_no_topics']} +

    +
    {$Data['folder_img']}{$Data['topic_icon']} + {$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&s={$ibforums->session_id}' class='linkthru' title='{$ibforums->lang['topic_started_on']} {$Data['start_date']}'>{$Data['title']} +
    {$Data['description']}
    {$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    {$Data['last_text']} {$Data['last_poster']}
    + + + + +
    + + + + +
    {$ibforums->lang['t_w_selected']} + +  
    +
    +
    +EOF; +} + +function move_checked_form_end($jump_html) { +global $ibforums; +return << +
    {$ibforums->lang['cp_tmove_to']}  
    +
    + +EOF; +} + +function move_checked_form_entry($tid, $title) { +global $ibforums; +return << +
    $title
    + + + EOF; } @@ -116,10 +152,10 @@ EOF; function archive_form($jump_html="") { global $ibforums; return <<{$ibforums->lang['archive_title']}
    {$ibforums->lang['archive_text']} +
    - - - + + - - + + - - + + - - + + - - + + - + EOF; @@ -157,7 +193,7 @@ function No_msg_inbox() { global $ibforums; return << - + EOF; } @@ -166,10 +202,10 @@ function prefs_add_dirs() { global $ibforums; return << - + - + EOF; } @@ -184,7 +220,7 @@ EOF; function Address_header() { global $ibforums; return <<{$ibforums->lang['address_current']} + EOF; } @@ -193,7 +229,7 @@ function Address_none() { global $ibforums; return << - + EOF; } @@ -201,10 +237,10 @@ EOF; function address_edit($data) { global $ibforums; return <<{$ibforums->lang['member_edit']} + -
    + + + + +EOF; +} + +} + +?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_msg.php b/upload/Skin/s1/skin_msg.php index e4d5e1fc..2add84be 100644 --- a/upload/Skin/s1/skin_msg.php +++ b/upload/Skin/s1/skin_msg.php @@ -7,16 +7,43 @@ function preview($data) { global $ibforums; return << -
    {$ibforums->lang['cp_tmove_start']} $forum_name
    + + + + +EOF; +} + + +function pm_errors($data) { +global $ibforums; +return << +
    + + +
    - + - + + +
    {$ibforums->lang['pm_preview']}{$ibforums->lang['pm_preview']}
    $data$data
    +
    +
    + + @@ -31,7 +58,7 @@ EOF; -function pm_popup($text) { +function pm_popup($text, $mid) { global $ibforums; return << @@ -42,21 +69,30 @@ return << -
    + + + + + +
    {$ibforums->lang['pme_title']}
    $data

    {$ibforums->lang['pme_none_sent']}
    +
    - + - +
    {$ibforums->lang['pmp_title']}{$ibforums->lang['pmp_title']}
    $text
    {$ibforums->lang['pmp_go_inbox']} ( {$ibforums->lang['pmp_thiswindow']} )

    {$ibforums->lang['pmp_ignore']}
    + {$ibforums->lang['pmp_get_last']} +

    + {$ibforums->lang['pmp_go_inbox']} ( {$ibforums->lang['pmp_thiswindow']} )

    {$ibforums->lang['pmp_ignore']}
    EOF; @@ -108,7 +144,7 @@ EOF; function archive_complete() { global $ibforums; return <<{$ibforums->lang['arc_comp_title']}
    {$ibforums->lang['arc_complete']}
    {$ibforums->lang['arc_comp_title']}
    {$ibforums->lang['arc_complete']}
    {$ibforums->lang['archive_title']}
    {$ibforums->lang['archive_text']}
    +
    @@ -127,27 +163,27 @@ return <<
    {$ibforums->lang['arc_folders']}$jump_html{$ibforums->lang['arc_folders']}$jump_html
    {$ibforums->lang['arc_dateline']}  {$ibforums->lang['arc_days']}{$ibforums->lang['arc_dateline']}  {$ibforums->lang['arc_days']}
    {$ibforums->lang['arc_max']}{$ibforums->lang['arc_max']}
    {$ibforums->lang['arc_delete']}{$ibforums->lang['arc_delete']}
    {$ibforums->lang['arc_type']}{$ibforums->lang['arc_type']}
    {$ibforums->lang['inbox_no_msg']}{$ibforums->lang['inbox_no_msg']}
    {$ibforums->lang['prefs_new']}{$ibforums->lang['prefs_new']}
    {$ibforums->lang['prefs_text_b']}{$ibforums->lang['prefs_text_b']}
    {$ibforums->lang['address_current']}
    {$ibforums->lang['address_none']}{$ibforums->lang['address_none']}
    {$ibforums->lang['member_edit']}
    + @@ -230,8 +266,8 @@ function render_address_row($entry) { global $ibforums; return << - - + @@ -243,10 +279,10 @@ function address_add($mem_to_add) { global $ibforums; return << - + - + EOF; } @@ -280,7 +316,7 @@ function prefs_row($data) { global $ibforums; return << - + EOF; } @@ -289,11 +325,11 @@ function Address_table_header() { global $ibforums; return << -
    vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$entry['contact_id']}'>{$entry['contact_name']}    [ {$entry['contact_desc']} ] + vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$entry['contact_id']}'>{$entry['contact_name']}    [ {$entry['contact_desc']} ] [ vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=11&MID={$entry['contact_id']}' class='misc'>{$ibforums->lang['edit']} ] :: [ vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=10&MID={$entry['contact_id']}'>{$ibforums->lang['delete']} ]   ( {$entry['text']} ) {$ibforums->lang['member_add']}{$ibforums->lang['member_add']}
    + @@ -258,7 +294,7 @@ return <<{$ibforums->lang['allow_msg']}
    - +
    @@ -271,7 +307,7 @@ function prefs_footer() { global $ibforums; return << -
    {$data[EXTRA]}{$data[EXTRA]}
    + - - + + EOF; } @@ -301,41 +337,69 @@ EOF; function Render_msg($data) { global $ibforums; return <<{$data['msg']['title']}
    {$data['msg']['msg_date']} -
    + + - + EOF; } -function inbox_table_header($dirname, $info) { +function trackread_table_header() { +global $ibforums; +return << + + +
    +
    + + + + + +EOF; +} + + + + + + + +function trackUNread_table_header() { +global $ibforums; +return << + + + + + + +EOF; +} + + + + +function unsent_table_header() { global $ibforums; return << @@ -384,25 +581,221 @@ return << -
    - - - +
    - - - - + + +EOF; +} + +function inbox_table_header($dirname, $info, $vdi_html="") { +global $ibforums; +return << + + + + + + + + + + - - - + + + + EOF; } @@ -453,19 +839,20 @@ function send_form_footer() { global $ibforums; return << - + - - + - @@ -475,39 +862,88 @@ EOF; function Send_form($data) { global $ibforums; return << + +
    + -
    - + + + + + - - - - - - + - - - - - + + EOF; } + + +function mass_pm_box($names="") { +global $ibforums; +return << + + + + + + +EOF; +} + + + function prefs_header() { global $ibforums; return <<{$ibforums->lang['prefs_current']} + - + diff --git a/upload/Skin/s1/skin_online.php b/upload/Skin/s1/skin_online.php index b8ef56eb..2451f632 100644 --- a/upload/Skin/s1/skin_online.php +++ b/upload/Skin/s1/skin_online.php @@ -8,7 +8,7 @@ function end($links) { global $ibforums; return << -
    {$ibforums->lang['member_name']}{$ibforums->lang['enter_block']}{$ibforums->lang['member_name']}{$ibforums->lang['enter_block']}
    - vars['php_ext']}?s={$ibforums->session_id}&CODE=04&act=Msg&MID={$data['member']['id']}&MSID={$data['msg']['msg_id']}'>{$ibforums->skin[M_REPLY]} -   - vars['php_ext']}?s={$ibforums->session_id}&CODE=02&act=Msg&MID={$data['member']['id']}'>{$ibforums->skin[M_ADDMEM]} -   - vars['php_ext']}?s={$ibforums->session_id}&CODE=05&act=Msg&MSID={$data['msg']['msg_id']}&VID={$data['member']['VID']}'>{$ibforums->skin[M_DELETE]} + + {$data['msg']['title']}
    {$data['msg']['msg_date']}
    + [ {$ibforums->lang['vm_forward_pm']} | {$ibforums->lang['pm_reply_link']} ]
    - +
    + + +
    + - - + + - - + - + +
    {$ibforums->lang['author']}{$ibforums->lang['m_pmessage']}{$ibforums->lang['author']} + + + + + +
    {$ibforums->lang['m_pmessage']}[ {$ibforums->lang['vm_delete_pm']} ]
    +
    {$data['member']['name']}
    {$data['member']['avatar']}
    {$data['member']['title']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    - + {$data['member']['name']}
    {$data['member']['avatar']}
    {$data['member']['title']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    + {$data['msg']['message']} {$data['member']['signature']}
    {$data['member']['MESSAGE_ICON']}{$data['member']['EMAIL_ICON']}{$data['member']['WEBSITE_ICON']}{$data['member']['ICQ_ICON']}{$data['member']['AOL_ICON']}{$data['member']['YAHOO_ICON']}[ {$ibforums->lang['add_to_book']} ]{$data['member']['MESSAGE_ICON']}{$data['member']['EMAIL_ICON']}{$data['member']['WEBSITE_ICON']}{$data['member']['ICQ_ICON']}{$data['member']['AOL_ICON']}{$data['member']['YAHOO_ICON']}
    +
    +
    @@ -344,13 +408,146 @@ return <<
    + [ {$ibforums->lang['vm_forward_pm']} | {$ibforums->lang['pm_reply_link']} ] +
    {$ibforums->lang['tk_read_messages']}
    {$ibforums->lang['tk_read_desc']}
    + + + + + + + + +EOF; +} + +function trackread_row($data) { +global $ibforums; +return << + + + + + + +EOF; +} + +function trackread_end() { +global $ibforums; +return << + + +
     {$ibforums->lang['message_title']}{$ibforums->lang['pms_message_to']}{$ibforums->lang['tk_read_date']}
    {$data['icon']}{$data['title']}{$data['to_name']}{$data['date']}
    {$ibforums->lang['selected_msg']}
    + +
    {$ibforums->lang['tk_unread_messages']}
    {$ibforums->lang['tk_unread_desc']}
    + + + + + + + + +EOF; +} + +function trackUNread_row($data) { +global $ibforums; +return << + + + + + + +EOF; +} + +function trackUNread_end() { +global $ibforums; +return << + + +
     {$ibforums->lang['message_title']}{$ibforums->lang['pms_message_to']}{$ibforums->lang['tk_unread_date']}
    {$data['icon']}{$data['title']}{$data['to_name']}{$data['date']}
    {$ibforums->lang['selected_msg']}
    + +
    $dirname
    {$ibforums->lang['total_messages']}: {$info['total_messages']} {$info['full_percent']}
    {$ibforums->lang['messages_left']} {$info['space_free']} {$info['full_messenger']}
    {$ibforums->lang['pms_saved_title']}
    - +
    - - - - - + + + + + + + +EOF; +} + + +function unsent_row($data) { +global $ibforums; +return << + + + + + + + +EOF; +} + +function unsent_end() { +global $ibforums; +return << + + +
     {$ibforums->lang['message_title']}{$ibforums->lang['message_from']}{$ibforums->lang['message_date']} {$ibforums->lang['message_title']}{$ibforums->lang['pms_message_to']}{$ibforums->lang['pms_saved_date']}{$ibforums->lang['pms_cc_users']}
    {$data['msg']['icon']}{$data['msg']['title']}{$data['msg']['to_name']}{$data['msg']['date']}{$data['msg']['cc_users']}
    {$ibforums->lang['selected_msg']}
    + +
    $dirname
    + + + + + + +
    + +
    + + + + +
    + + + + + + + + + + + + +
    {$info['full_messenger']}
    0%50%100%
    +
    +
    + {$ibforums->lang['pmpc_mark_read']} :: {$ibforums->lang['pmpc_unmark_all']}

    +
    + {$ibforums->lang['goto_folder']}:   $vdi_html +
    +
    +
    +
    + + + + + + + EOF; } @@ -411,40 +804,33 @@ function inbox_row($data) { global $ibforums; return << - - - - - + + + + + EOF; } -function end_inbox($vdi_html) { +function end_inbox($vdi_html, $amount_info="") { global $ibforums; return << -
     {$ibforums->lang['message_title']}{$ibforums->lang['message_from']}{$ibforums->lang['message_date']}
    {$data['msg']['icon']}vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=03&VID={$data['stat']['current_id']}&MSID={$data['msg']['msg_id']}'>{$data['msg']['title']}vars['php_ext']}?s={$ibforums->session_id}&act=Profile&MID={$data['msg']['from_id']}'>{$data['msg']['from_name']} {$data['msg']['add_to_contacts']}{$data['msg']['date']}{$data['msg']['icon']}vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=03&VID={$data['stat']['current_id']}&MSID={$data['msg']['msg_id']}'>{$data['msg']['title']}vars['php_ext']}?s={$ibforums->session_id}&act=Profile&MID={$data['msg']['from_id']}'>{$data['msg']['from_name']} {$data['msg']['add_to_contacts']}{$data['msg']['date']}
    + $vdi_html {$ibforums->lang['move_or_delete']} {$ibforums->lang['selected_msg']}
    -
    - {$ibforums->skin['M_READ']} {$ibforums->lang['icon_read']} -  {$ibforums->skin['M_UNREAD']} {$ibforums->lang['icon_unread']} -
    - - - - {$ibforums->lang['goto_folder']}:   $vdi_html - -
    -
    + <{M_READ}> {$ibforums->lang['icon_read']} +  <{M_UNREAD}> {$ibforums->lang['icon_unread']} + $amount_info
    {$ibforums->lang['msg_options']}{$ibforums->lang['msg_options']}
      +    {$ibforums->lang['auto_sent_add']} -
     {$ibforums->lang['read_rec_notify']} +
     {$ibforums->lang['vm_track_msg']}
    + +
    {$ibforums->lang['to_whom']}
    + + + + + + + + + + + + + +
    {$ibforums->lang['to_whom']}
    {$ibforums->lang['address_list']}{$data[CONTACTS]}
    {$ibforums->lang['enter_name']}
    +
     
    {$ibforums->lang['address_list']}{$data[CONTACTS]}
    {$ibforums->lang['enter_name']}{$ibforums->lang['enter_message']}
    {$ibforums->lang['enter_message']}
    {$ibforums->lang['msg_title']}{$ibforums->lang['msg_title']}
    {$ibforums->lang['carbon_copy_title']}
    {$ibforums->lang['carbon_copy_desc']} + + + + + +
    + +
    +
    {$ibforums->lang['prefs_current']}
    {$ibforums->lang['prefs_text_a']}{$ibforums->lang['prefs_text_a']}
    +
    @@ -21,10 +21,10 @@ global $ibforums; return << - - - - + + + + EOF; @@ -35,14 +35,14 @@ global $ibforums; return << - +
    {$links[SHOW_PAGES]}
    {$session['member_name']}{$session['where_line']}{$session['running_time']}{$session['msg_icon']}{$session['member_name']}{$session['where_line']}{$session['running_time']}{$session['msg_icon']}
      

    - +
    @@ -74,21 +74,21 @@ return << -
    $links
    +
    $links

    - +
    @@ -106,10 +206,10 @@ function PostIcons() { global $ibforums; return << - - + @@ -120,12 +220,12 @@ EOF; function errors($data) { global $ibforums; return << +
    - - - - + + + + EOF; } diff --git a/upload/Skin/s1/skin_poll.php b/upload/Skin/s1/skin_poll.php index 7f0cbfdf..4dfb81a7 100644 --- a/upload/Skin/s1/skin_poll.php +++ b/upload/Skin/s1/skin_poll.php @@ -22,42 +22,65 @@ function Render_row_form($votes, $id, $answer) { global $ibforums; return << - + EOF; } -function ShowPoll_header($tid, $edit, $delete) { +function ShowPoll_header($tid, $poll_q, $edit, $delete) { global $ibforums; return << - - - -
    -
    {$ibforums->lang['member_name']}{$ibforums->lang['where']}{$ibforums->lang['time']} {$ibforums->lang['member_name']}{$ibforums->lang['where']}{$ibforums->lang['time']} 
     $answer $answer
    +
    - +
    - +
    - + - - - +
    $edit   $delete $edit   $delete
    {$ibforums->lang['poll_s_choices']}{$ibforums->lang['poll_s_votes']}{$ibforums->lang['poll_s_stats']} + + + + +EOF; +} + +function ShowPoll_Form_header($tid, $poll_q, $edit, $delete) { +global $ibforums; +return << + + + + - - + + + EOF; } diff --git a/upload/Skin/s1/skin_post.php b/upload/Skin/s1/skin_post.php index bd75b4af..362d9609 100644 --- a/upload/Skin/s1/skin_post.php +++ b/upload/Skin/s1/skin_post.php @@ -20,6 +20,17 @@ return << + + + +EOF; +} + function table_top($data) { global $ibforums; return << -
    $poll_q
    + + + + + +
    $edit   $delete
    + + + + EOF; } function ShowPoll_footer($vote_button) { global $ibforums; return << + -
    $poll_q
    - $vote_button + + $vote_button
    - +
    +
    + EOF; } @@ -65,9 +88,9 @@ function Render_row_results($votes, $id, $answer, $percentage, $width) { global $ibforums; return << - $answer$votes [$percentage%]$answer [ $votes ]  [$percentage%]
    {$ibforums->lang['edit_ops']} {$ibforums->lang['append_edit']}
    +
    - - + + +
    +  
    + - + EOF; } +function calendar_start_form() { +global $ibforums; +return << +EOF; +} + +function calendar_start_edit_form($eventid) { +global $ibforums; +return << +EOF; +} + + + +function calendar_event_title($data="") { +global $ibforums; +return << + + + +EOF; +} + +function calendar_delete_box() { +global $ibforums; +return << + + +EOF; +} + +function calendar_choose_date($days, $months, $years) { +global $ibforums; +return << + + + +EOF; +} + +function calendar_event_type($pub_select="", $priv_select="") { +global $ibforums; +return << + + + +EOF; +} + +function calendar_admin_group_box($groups) { +global $ibforums; +return << + + + +EOF; +} + + + + + +function calendar_end_form($data) { +global $ibforums; +return << + + +
    $data$data
    {$ibforums->lang['calendar_title']}
     {$ibforums->lang['calendar_delete_box']}
    {$ibforums->lang['calendar_event_date']}    
    {$ibforums->lang['calendar_event_type']}
    {$ibforums->lang['calendar_group_filter']}
    +
    +EOF; +} + + + + + + + function EndForm($data) { global $ibforums; return << -
      +  
    @@ -75,13 +175,13 @@ EOF; function smilie_table() { global $ibforums; return << + - +
    {$ibforums->lang['click_smilie']}
    {$ibforums->lang['all_emoticons']}{$ibforums->lang['all_emoticons']}
    EOF; @@ -92,7 +192,7 @@ global $ibforums; return <<
    {$ibforums->lang['review_topic']}{$ibforums->lang['review_topic']}
    {$ibforums->lang['post_icon']} -                                    
    -                                     +
    {$ibforums->lang['post_icon']} +                                    
    +                                    
      [ Use None ]
    @@ -139,28 +239,57 @@ function Upload_field($data) { global $ibforums; return << - + - - + + EOF; } +function edit_upload_field($data, $file_name="") { +global $ibforums; +return << + + + + + + +EOF; +} + + function topictitle_fields($data) { global $ibforums; return << - + - - + + - - + + EOF; } @@ -168,9 +297,9 @@ EOF; function TopicSummary_body($data) { global $ibforums; return << - - + + + EOF; } @@ -178,12 +307,12 @@ EOF; function preview($data) { global $ibforums; return << +
    - +
    {$ibforums->lang['errors_found']}
    $data
    {$ibforums->lang['errors_found']}
    $data
    {$ibforums->lang['upload_title']}{$ibforums->lang['upload_title']}
    {$ibforums->lang['upload_text']} $data{$ibforums->lang['upload_text']} $data
    {$ibforums->lang['upload_title']}
    {$ibforums->lang['upload_text']} $data + + + + + + + + + + + + + +
    {$ibforums->lang['eu_keep']} ( $file_name )
    {$ibforums->lang['eu_delete']}
    {$ibforums->lang['eu_new']}
    +
    {$ibforums->lang['tt_topic_settings']}{$ibforums->lang['tt_topic_settings']}
    {$ibforums->lang['topic_title']}{$ibforums->lang['topic_title']}
    {$ibforums->lang['topic_desc']}{$ibforums->lang['topic_desc']}
    {$data['author']}{$ibforums->lang['posted_on']} {$data['date']}
    {$data['post']}
    {$data['author']}{$ibforums->lang['posted_on']} {$data['date']}
    {$data['post']}
    @@ -199,12 +328,12 @@ return <<
    -
    - +
    {$ibforums->lang['post_preview']}
    $data
    {$ibforums->lang['post_preview']}
    $data
    +
    \n \n \n \n \n \n \n \n \n \n \n', 'show_row', '$member', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\nbase_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n\n', 'move_form', '$jhtml, $forum_name', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n \n \n', 'delete_js', '', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n\n \n \n \n \n \n \n \n \n\n\n', 'topictitle_fields', '$title, $desc', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n \n \n', 'poll_entry', '$id, $entry', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n \n \n', 'poll_select_form', '', 1035406239, 0);||~&~||(1, 'skin_mod', '\n
    \n
    - + EOF; @@ -221,11 +350,11 @@ function mod_options($jump) { global $ibforums; return << - + - - + + EOF; } @@ -234,11 +363,11 @@ function quote_box($data) { global $ibforums; return << - + - - + EOF; @@ -252,6 +381,8 @@ return << - - - + - - \n \n \n', 'no_results', '', 1035406237, 0);||~&~||(1, 'skin_help', '\n
    {$ibforums->lang['last_posts']}{$ibforums->lang['last_posts']}
    {$ibforums->lang['tt_options']}{$ibforums->lang['tt_options']}
    {$ibforums->lang['mod_options']}$jump{$ibforums->lang['mod_options']}$jump
    {$ibforums->lang['post_to_quote']}{$ibforums->lang['post_to_quote']}
    {$ibforums->lang['post_to_quote_txt']} + {$ibforums->lang['post_to_quote_txt']}
    {$ibforums->lang['ib_code_buttons']}{$ibforums->lang['ib_code_buttons']}
    {$ibforums->lang['ibf_code_txt']} - + + + - + - - \n \n
    +  {$ibforums->lang['bbcode_guided']}
    +  {$ibforums->lang['bbcode_normal']} +
    + - - + + + +
    - - - + + + - @@ -339,12 +491,12 @@ function CheckLength() { - +   {$ibforums->lang['js_close_all_tags']} Close Current Tag
    - - - - - - - - - Close All Tags + + + + + + +
    + {$ibforums->lang['hb_open_tags']}:  +   +
    {$ibforums->lang['post']}{$ibforums->lang['post']}
    ({$ibforums->lang['check_length']})

    + + + +EOF; +} + +function pm_postbox_buttons($data) { +global $ibforums; +return << + + + + + + + + + + + + + + + + EOF; @@ -397,24 +735,28 @@ function nameField_unreg($data) { global $ibforums; return << - + - - + + EOF; } -function poll_box($data) { +function poll_box($data, $extra="") { global $ibforums; return << - + - - + + + + + - -
    ({$ibforums->lang['check_length']})

    + + +
    {$ibforums->lang['enable_emo']}
    {$ibforums->lang['enable_sig']}
    {$ibforums->lang['ib_code_buttons']}
    +  {$ibforums->lang['bbcode_guided']}
    +  {$ibforums->lang['bbcode_normal']} +
    + + + + + + + + + + + +
    + + + + + +   {$ibforums->lang['js_close_all_tags']} +
    + + + + + + + +
    + {$ibforums->lang['hb_open_tags']}:  +   +
    +
    {$ibforums->lang['post']}
    ({$ibforums->lang['check_length']})

    + + + + + + + + + +
    {$ibforums->lang['enable_emo']}
    {$ibforums->lang['enable_sig']}
    {$ibforums->lang['unreg_namestuff']}{$ibforums->lang['unreg_namestuff']}
    {$ibforums->lang['guest_name']}{$ibforums->lang['guest_name']}
    {$ibforums->lang['tt_poll_settings']}{$ibforums->lang['tt_poll_settings']}
    {$ibforums->lang['poll_choices']} + {$ibforums->lang['poll_question']}
    {$ibforums->lang['poll_choices']}

    $extra
    diff --git a/upload/Skin/s1/skin_printpage.php b/upload/Skin/s1/skin_printpage.php index 97a53065..219ee823 100644 --- a/upload/Skin/s1/skin_printpage.php +++ b/upload/Skin/s1/skin_printpage.php @@ -2,48 +2,86 @@ class skin_printpage { +function choose_form($fid, $tid, $title) { +global $ibforums; +return << +
    + + + +
    + + + + + + + +
    {$ibforums->lang['tvo_title']} $title
    + {$ibforums->lang['o_print_title']} +
    + {$ibforums->lang['o_print_desc']} +

    + {$ibforums->lang['o_html_title']} +
    + {$ibforums->lang['o_html_desc']} +

    + {$ibforums->lang['o_word_title']} +
    + {$ibforums->lang['o_word_desc']} +



    + <<{$ibforums->lang['back_topic']} +
    +
    + +EOF; +} + function pp_postentry($poster, $entry ) { global $ibforums; return <<{$ibforums->lang['by']}: {$entry['author_name']} {$this->class['LANG']['on']} {$entry['post_date']} -

    - {$entry['post']} -
    + + + + + + + +
    {$ibforums->lang['by']}: {$entry['author_name']} {$ibforums->lang['on']} {$entry['post_date']}
    {$entry['post']}
    +
    EOF; } function pp_end() { global $ibforums; return <<{$ibforums->lang['end']} -
    +
    Powered by Invision Board (http://www.invisionboard.com)
    © Invision Power Services (http://www.invisionpower.com)
    EOF; } -function pp_header($forum_name, $topic_title, $topic_starter) { +function pp_header($forum_name, $topic_title, $topic_starter,$fid, $tid) { global $ibforums; return << - {$ibforums->vars['board_name']} [Powered by IB Forums] + {$ibforums->vars['board_name']} [Powered by IB Forums] - - - \n \n \n \n', 'row', '$entry', 1035406237, 0);||~&~||(1, 'skin_help', '\n \n \n \n \n \n', 'display', '$text', 1035406237, 0);||~&~||(1, 'skin_help', '\n
    - - {$ibforums->lang['title']} -

    - -{$ibforums->vars['board_name']}
    - +--{$ibforums->lang['forum']}: $forum_name
    - +---{$ibforums->lang['topic']}: $topic_title {$ibforums->lang['start']} $topic_starter -
    -
    -
    + + + + + + + +
    {$ibforums->lang['title']} +
    {$ibforums->lang['topic_here']} +
    {$ibforums->vars['board_name']} > $forum_name > $topic_title
    +
    +
    EOF; } diff --git a/upload/Skin/s1/skin_profile.php b/upload/Skin/s1/skin_profile.php index d02de745..94fd1100 100644 --- a/upload/Skin/s1/skin_profile.php +++ b/upload/Skin/s1/skin_profile.php @@ -18,38 +18,38 @@ EOF; function show_profile($info) { global $ibforums; return << + - + -
    {$info['name']}{$info['name']}
    {$ibforums->lang['find_posts']} | + {$ibforums->lang['find_posts']} | {$ibforums->lang['add_to_contact']}
    - +
    \n \n \n \n \n \n
    - +
    - - -
    - + - -
    + - + - + - + - + @@ -64,30 +64,30 @@ return << - + +EOF; +} + +function field_entry($title, $desc="", $content) { +global $ibforums; +return << + + + +EOF; +} + +function field_textinput($name, $value="") { +global $ibforums; +return << +EOF; +} + +function field_dropdown($name, $options) { +global $ibforums; +return <<$options +EOF; +} + +function field_textarea($name, $value) { +global $ibforums; +return <<$value +EOF; +} } ?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_search.php b/upload/Skin/s1/skin_search.php index 597fc050..7192bfce 100644 --- a/upload/Skin/s1/skin_search.php +++ b/upload/Skin/s1/skin_search.php @@ -1,292 +1,397 @@ - - - - - - - - - - - - -EOF; -} - -function end($Data) { -global $ibforums; -return << -
    {$ibforums->lang['active_stats']}{$ibforums->lang['active_stats']}
    {$ibforums->lang['total_posts']}{$info['posts']}
    ( {$info['total_pct']}% {$ibforums->lang['total_percent']} )
    {$info['posts']}
    ( {$info['total_pct']}% {$ibforums->lang['total_percent']} )
    {$ibforums->lang['posts_per_day']}{$info['posts_day']}{$info['posts_day']}
    {$ibforums->lang['joined']}{$info['joined']}{$info['joined']}
    {$ibforums->lang['fav_forum']} - + + + +
    + - + - + - + - + - + - + @@ -101,48 +101,49 @@ return << - + + +
    {$ibforums->lang['communicate']}{$ibforums->lang['communicate']}
    {$ibforums->lang['email']}{$info['email']}{$info['email']}
    {$ibforums->lang['aim']}{$info['aim_name']}{$info['aim_name']}
    {$ibforums->lang['icq']}{$info['icq_number']}{$info['icq_number']}
    {$ibforums->lang['yahoo']}{$info['yahoo']}{$info['yahoo']}
    {$ibforums->lang['msn']}{$info['msn_name']}{$info['msn_name']}
    {$ibforums->lang['pm']}
    - + - + + +
    + - - - - - - - - - + - + - + - + +
    {$ibforums->lang['info']}
    {$ibforums->lang['mgroup']}{$info['group_title']}
    {$ibforums->lang['mtitle']}{$info['member_title']}{$ibforums->lang['info']}
    {$ibforums->lang['homepage']}{$info['homepage']}{$info['homepage']}
    {$ibforums->lang['birthday']}{$info['birthday']}{$info['birthday']}
    {$ibforums->lang['location']}{$info['location']}{$info['location']}
    {$ibforums->lang['interests']} {$info['interests']}
    - + @@ -161,6 +162,15 @@ return << + + + +EOF; +} } ?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_register.php b/upload/Skin/s1/skin_register.php index e1075b82..5b6d9540 100644 --- a/upload/Skin/s1/skin_register.php +++ b/upload/Skin/s1/skin_register.php @@ -3,6 +3,153 @@ class skin_register { +function coppa_form() { +global $ibforums; +return << + + {$ibforums->lang['cpf_title']} + + + +
    + - + + + + + + + + + - + @@ -152,7 +153,7 @@ return << - +
    {$ibforums->lang['post_detail']}{$ibforums->lang['post_detail']}
    {$ibforums->lang['mgroup']}{$info['group_title']}
    {$ibforums->lang['mtitle']}{$info['member_title']}
    {$ibforums->lang['avatar']}{$info['avatar']}{$info['avatar']}
    {$ibforums->lang['siggie']}
    <( {$ibforums->lang['back']} )<( {$ibforums->lang['back']} )
    $title$value
    + + + +
    + {$ibforums->vars['board_name']}: {$ibforums->lang['cpf_title']} +

    + {$ibforums->lang['cpf_perm_parent']} +

    + {$ibforums->lang['cpf_fax']} {$ibforums->vars['coppa_fax']} +

    + {$ibforums->lang['cpf_address']} +
    + {$ibforums->vars['coppa_address']} + +
    +
    + + + + + + + + + + + + + +
    {$ibforums->lang['user_name']} 
    {$ibforums->lang['pass_word']} 
    {$ibforums->lang['email_address']} 
    +
    + + + + +
    + {$ibforums->lang['cpf_sign']} +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['cpf_name']} 
    {$ibforums->lang['cpf_relation']} 
    {$ibforums->lang['cpf_signature']} 
    {$ibforums->lang['cpf_email']} 
    {$ibforums->lang['cpf_phone']} 
    {$ibforums->lang['cpf_date']} 
    + + +EOF; +} + +function coppa_two() { +global $ibforums; +return << +
    + + + + + + + + + + + + + +
    {$ibforums->lang['cp2_title']}
    + {$ibforums->lang['cp2_text']} +

    +
    + << {$ibforums->lang['cp2_cancel']} + - {$ibforums->lang['cp2_continue']} >> +
    +
    {$ibforums->lang['coppa_form']}
    {$ibforums->lang['coppa_form_text']} {$ibforums->vars['email_in']}
    +
    +EOF; +} + +function coppa_start($coppadate) { +global $ibforums; +return << +
    + + + + + + + + + + + + + +
    {$ibforums->lang['coppa_info']}
    +

    + {$ibforums->lang['coppa_link']} +

    + < {$ibforums->lang['coppa_date_before']} $coppadate + - {$ibforums->lang['coppa_date_after']} $coppadate > +

      +
    {$ibforums->lang['coppa_form']}
    {$ibforums->lang['coppa_form_text']} {$ibforums->vars['email_in']}
    +
    +EOF; +} + + function lost_pass_form() { global $ibforums; @@ -11,25 +158,25 @@ return << - +
    {$ibforums->lang['lp_header']}

    {$ibforums->lang['lp_text']}

    - +
    - + - - + + -
    {$ibforums->lang['complete_form']}{$ibforums->lang['complete_form']}
    {$ibforums->lang['lp_user_name']}{$ibforums->lang['lp_user_name']}
    +
    @@ -40,15 +187,15 @@ EOF; function show_authorise($member) { global $ibforums; return << + @@ -60,15 +207,15 @@ EOF; function show_preview($member) { global $ibforums; return << +
    - + - +
    {$ibforums->lang['registration_process']}{$ibforums->lang['registration_process']}
    {$ibforums->lang['thank_you']} {$member['name']}. {$ibforums->lang['auth_text']} {$member['email']}{$ibforums->lang['thank_you']} {$member['name']}. {$ibforums->lang['auth_text']} {$member['email']}
    @@ -97,29 +244,29 @@ return << -
    - + - +
    {$ibforums->lang['registration_process']}{$ibforums->lang['registration_process']}
    {$ibforums->lang['thank_you']} {$member['name']}. {$ibforums->lang['preview_reg_text']}{$ibforums->lang['thank_you']} {$member['name']}. {$ibforums->lang['preview_reg_text']}
    +
    {$ibforums->lang['dumb_header']}

    {$ibforums->lang['dumb_text']}

    - +
    - + - - + + - - + + -
    {$ibforums->lang['complete_form']}{$ibforums->lang['complete_form']}
    {$ibforums->lang['user_id']}{$ibforums->lang['user_id']}
    {$ibforums->lang['val_key']}{$ibforums->lang['val_key']}
    +
    @@ -154,59 +301,63 @@ return << - + +
    {$ibforums->lang['reg_header']}

    {$data['TEXT']}

    - +
    - + - - + + - - + + - - + + - - + + - - + + + +
    {$ibforums->lang['complete_form']}{$ibforums->lang['complete_form']}
    {$ibforums->lang['user_name']}{$ibforums->lang['user_name']}
    {$ibforums->lang['pass_word']}{$ibforums->lang['pass_word']}
    {$ibforums->lang['re_enter_pass']}{$ibforums->lang['re_enter_pass']}
    {$ibforums->lang['email_address']}{$ibforums->lang['email_address']}
    {$ibforums->lang['email_address_two']}{$ibforums->lang['email_address_two']}
    +
    - +
    - + - -
    {$ibforums->lang['terms_service']}{$ibforums->lang['terms_service']}
    {$ibforums->lang['terms_service_text']}
    +
    {$ibforums->lang['terms_service_text']}


    {$ibforums->lang['agree_submit']} 
    +
    @@ -214,6 +365,99 @@ return << +
    + + + + +
    {$ibforums->lang['errors_found']}
    $data
    +
    +
    +EOF; +} + +function reg_antispam($regid) { +global $ibforums; +return << + + + + +
    + + + + + + + + + + + + +
    {$ibforums->lang['ras_title']}
    {$ibforums->lang['ras_numbers']} + + Code Bit +  Code Bit +  Code Bit +  Code Bit +  Code Bit +  Code Bit +
    {$ibforums->lang['ras_text']}
    +
    +EOF; +} + + + +function optional_title() { +global $ibforums; +return << +
    {$ibforums->lang['cf_optional']}
    $title
    $desc
    $content
    {$Data['folder_img']}{$Data['topic_icon']} - - - - - -
    {$Data['go_new_post']}{$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&hl={$Data['keywords']}&s={$ibforums->session_id}' id='linkthru'>{$Data['title']} {$Data[PAGES]}
    - {$Data['description']}
    {$Data['forum_name']}{$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$Data['forum_id']}&t={$Data['tid']}&view=getlastpost'>{$Data['last_text']} {$Data['last_poster']}
     
    -
    -
    - - - - -
    {$Data[SHOW_PAGES]}
    - - - - - - - - - - - - - -
    {$ibforums->skin['B_NEW']} {$ibforums->lang['pm_open_new']}{$ibforums->skin['B_HOT']} {$ibforums->lang['pm_hot_new']}{$ibforums->skin['B_POLL']} {$ibforums->lang['pm_poll']}{$ibforums->skin['B_LOCKED']} {$ibforums->lang['pm_locked']}
    {$ibforums->skin['B_NORM']} {$ibforums->lang['pm_open_no']}{$ibforums->skin['B_HOT_NN']} {$ibforums->lang['pm_hot_no']}{$ibforums->skin['B_POLL_NN']} {$ibforums->lang['pm_poll_no']}{$ibforums->skin['B_MOVED']} {$ibforums->lang['pm_moved']}
    -EOF; -} - -function Form($forums, $cats) { -global $ibforums; -return << -
    - - - - $hidden_fields -
    - - - - -
    - - - - - - - - - - - - -
    {$ibforums->lang['keywords_title']}
    {$ibforums->lang['key_search']}{$ibforums->lang['mem_search']}
     

    {$ibforums->lang['keysearch_text']}


     {$ibforums->lang['match_name_ex']}
     {$ibforums->lang['match_name_pa']}
    -
    - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    {$ibforums->lang['search_options']}
    {$ibforums->lang['search_where']}{$ibforums->lang['search_refine']}
    - - - - - - - - - - - - - -
     {$ibforums->lang['search_cats']}$cats
     {$ibforums->lang['search_forums']}$forums
     {$ibforums->lang['in_posts']} {$ibforums->lang['in_topics']}
    -
    - - - - - -
    - {$ibforums->lang['search_from']} -
    - -
    {$ibforums->lang['and']}  {$ibforums->lang['older']}  {$ibforums->lang['newer']} -
    - {$ibforums->lang['sort_results']}
    - -
    {$ibforums->lang['descending']} -
    {$ibforums->lang['ascending']} -
    -
    -
    -
    - -EOF; -} - -function active_start($Data) { -global $ibforums; -return << - - -
    - - - - - -
    {$ibforums->lang['active_topics']}
    {$Data[SHOW_PAGES]}
    -
    vars['php_ext']}' method='POST' name='dateline' onSubmit='return checkvalues();'> - - - -
    - - - - - - \n \n \n \n \n
    - {$ibforums->lang['active_st_text']} - -   {$ibforums->lang['active_end_text']}   - -    -
    - - - + +
    - - - - - - - - - - -EOF; -} - -function start($Data) { -global $ibforums; -return << -
     {$ibforums->lang['h_topic_title']}{$ibforums->lang['h_forum_name']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}
    - - - -
    {$Data[SHOW_PAGES]}
    - - - + +
    - - - +
    - - - - - - - - - - -EOF; -} - -function active_none() { -global $ibforums; -return << -EOF; -} - - -} + + + + + + + + + + + + +EOF; +} + +function RenderPostRow($Data) { +global $ibforums; +return << + + + + + + + + + + + + + + + +EOF; +} + +function start_as_post($Data) { +global $ibforums; +return << +
     {$ibforums->lang['h_topic_title']}{$ibforums->lang['h_forum_name']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}
    {$ibforums->lang['active_no_topics']}
    {$Data['folder_img']}{$Data['topic_icon']} + + + + + +
    {$Data['go_new_post']}{$Data['prefix']} vars['php_ext']}?act=ST&f={$Data['forum_id']}&t={$Data['tid']}&hl={$Data['keywords']}&s={$ibforums->session_id}' class='linkthru'>{$Data['title']} {$Data[PAGES]}
    + {$Data['description']}
    {$Data['forum_name']}{$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$Data['forum_id']}&t={$Data['tid']}&view=getlastpost'>{$Data['last_text']} {$Data['last_poster']}
    + + + + + +
    {$Data['folder_img']}{$ibforums->lang['rp_topic']} {$Data['prefix']} {$Data['title']} {$Data[PAGES]}
    +
    {$Data['author_name']} + {$ibforums->lang['rp_forum']} {$Data['forum_name']}    {$ibforums->lang['rp_postedon']} {$Data['post_date']}    {$ibforums->lang['rp_post']} #{$Data['pid']} +
    + +
    + {$ibforums->lang['rp_replies']} {$Data['posts']}
    {$ibforums->lang['rp_hits']} {$Data['views']}
    +
    {$Data['post']}
    + + + +
    {$Data[SHOW_PAGES]}
    + + + + +
    + + + + +
    + + + + + +EOF; +} + +function end_as_post($Data) { +global $ibforums; +return << +
    {$ibforums->lang['rp_author']}{$ibforums->lang['rp_message']}
     
    +
    +
    + + + + +
    {$Data[SHOW_PAGES]}
    + + + + + + + + + + + + + +
    <{B_NEW}> {$ibforums->lang['pm_open_new']}<{B_HOT}> {$ibforums->lang['pm_hot_new']}<{B_POLL}> {$ibforums->lang['pm_poll']}<{B_LOCKED}> {$ibforums->lang['pm_locked']}
    <{B_NORM}> {$ibforums->lang['pm_open_no']}<{B_HOT_NN}> {$ibforums->lang['pm_hot_no']}<{B_POLL_NN}> {$ibforums->lang['pm_poll_no']}<{B_MOVED}> {$ibforums->lang['pm_moved']}
    +EOF; +} + + +function end($Data) { +global $ibforums; +return <<
     
    +
    +
    + + + + +
    {$Data[SHOW_PAGES]}
    + + + + + + + + + + + + + +
    <{B_NEW}> {$ibforums->lang['pm_open_new']}<{B_HOT}> {$ibforums->lang['pm_hot_new']}<{B_POLL}> {$ibforums->lang['pm_poll']}<{B_LOCKED}> {$ibforums->lang['pm_locked']}
    <{B_NORM}> {$ibforums->lang['pm_open_no']}<{B_HOT_NN}> {$ibforums->lang['pm_hot_no']}<{B_POLL_NN}> {$ibforums->lang['pm_poll_no']}<{B_MOVED}> {$ibforums->lang['pm_moved']}
    +EOF; +} + +function Form($forums, $cats) { +global $ibforums; +return << + + +
    + $hidden_fields +
    + + + + +
    + + + + + + + + + + + + +
    {$ibforums->lang['keywords_title']}
    {$ibforums->lang['key_search']}{$ibforums->lang['mem_search']}


    {$ibforums->lang['keysearch_text']}
    + + + + + + + +
    +  {$ibforums->lang['match_name_ex']} +
     {$ibforums->lang['match_name_pa']} +
    +  {$ibforums->lang['joinname_true']} +
     {$ibforums->lang['joinname_false']} +
    +
    +
    + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['search_options']}
    {$ibforums->lang['search_where']}{$ibforums->lang['search_refine']}
    + + + + + + + + + + + + + +
     {$ibforums->lang['search_cats']}$cats
     {$ibforums->lang['search_forums']}$forums
     {$ibforums->lang['in_posts']}
     {$ibforums->lang['in_topics']}
     {$ibforums->lang['results_topics']}
     {$ibforums->lang['results_post']}
    +
    + + + + + +
    + {$ibforums->lang['search_from']} +
    + +
    {$ibforums->lang['and']}  {$ibforums->lang['older']}  {$ibforums->lang['newer']} +
    + {$ibforums->lang['sort_results']}
    + +
    {$ibforums->lang['descending']} +
    {$ibforums->lang['ascending']} +
    +
    +
    +
    + +EOF; +} + +function active_start($Data) { +global $ibforums; +return << + + +
    + + + + + +
    {$ibforums->lang['active_topics']}
    {$Data[SHOW_PAGES]}
    +
    +
    + + + + + + \n \n \n \n \n \n \n \n \n \n \n', 'msn_body', '$msnname', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'yahoo_body', '$yahoo', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'icq_body', '$data', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \n
    + {$ibforums->lang['active_st_text']} + +   {$ibforums->lang['active_end_text']}   + +    +
    + + + \n', 'cal_day_bit', '$day', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n\n \n \n \n \n', 'cal_new_row', '', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n\n \n \n', 'cal_blank_cell', '', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n\n \n \n', 'cal_date_cell', '$month_day, $events=""', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n\n \n \n', 'cal_date_cell_today', '$month_day, $events=""', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n \n
    \n', 'cal_events_start', '', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n
  • base_url}&act=calendar&$link\'>$text\n', 'cal_events_wrap', '$link, $text', 1035406236, 0);||~&~||(1, 'skin_calendar', '\n \n', 'cal_events_end', '', 1035406236, 0);||~&~||(1, 'skin_emails', '\n
    \n \n
  • + + + + + + + + + + +EOF; +} + +function start($Data) { +global $ibforums; +return << +
     {$ibforums->lang['h_topic_title']}{$ibforums->lang['h_forum_name']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}
    + + + +
    {$Data[SHOW_PAGES]}
    + + + "; - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - } - -} - - -//---------------------------------- -// Ok, so far so good. If we have a -// validate session, check the running -// time. if it's older than 2 hours, -// ask for a log in -//---------------------------------- - - -if ($session_validated == 1) -{ - if ($this_session['RUNNING_TIME'] < ( time() - 60*60*2) ) - { - $session_validated = 0; - do_login("This administration session has expired"); - } - - //------------------------------ - // Are we checking IP's? - //------------------------------ - - else if ($check_ip == 1) - { - if ($this_session['IP_ADDRESS'] != $IN['IP_ADDRESS']) - { - $session_validated = 0; - do_login("Your current IP address does not match the one in our records"); - } - } -} - -if ($session_validated == 1 ) -{ - //------------------------------ - // If we get this far, we're good to go.. - //------------------------------ - - $IN['AD_SESS'] = $IN['adsess']; - - //------------------------------ - // Lets update the sessions table: - //------------------------------ - - $DB->query("UPDATE ibf_admin_sessions SET RUNNING_TIME='".time()."', LOCATION='".$IN['act']."' WHERE MEMBER_ID='".$MEMBER['id']."' AND ID='".$IN['AD_SESS']."'"); - - do_admin_stuff(); - -} -else -{ - //------------------------------ - // Session is not validated... - //------------------------------ - - do_login("Session not validated - please attempt to log in again"); - -} - - - -function do_login($message="") { - global $IN, $DB, $ADMIN, $SKIN; - - //------------------------------------------------------- - // Remove all out of date sessions, like a good boy. Woof. - //------------------------------------------------------- - - $cut_off_stamp = time() - 60*60*2; - - $DB->query("DELETE FROM ibf_admin_sessions WHERE RUNNING_TIME < $cut_off_stamp"); - - //+------------------------------------------------------ - - $ADMIN->page_detail = "You must have administrative access to successfully log into the Invision Board Admin CP.
    Please enter your forums username and password below"; - - if ($message != "") - { - $ADMIN->page_detail .= "

    $message"; - } - - $ADMIN->html .= " - "; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array('login', 'yes') ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Verification Required" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Your Forums Username:", - "", - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Your Forums Password:", - "", - ) ); - - $ADMIN->html .= $SKIN->end_form("Log in"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - -} - - - - - -function do_admin_stuff() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; - - - /*---------------------------------- - What do you want to require today? - ------------------------------------*/ - - $choice = array( - "idx" => "doframes", - "menu" => "menu", - "index" => "index", - "cat" => "categories", - "forum" => "forums", - "mem" => "member", - 'group' => "groups", - 'mod' => 'moderator', - 'op' => 'settings', - 'help' => 'help', - 'skin' => 'skins', - 'wrap' => 'wrappers', - 'style' => 'stylesheets', - 'image' => 'imagemacros', - 'sets' => 'stylesets', - 'templ' => 'templates', - 'lang' => 'languages', - 'import' => 'skin_import', - 'modlog' => 'modlogs', - ); - - - /***************************************************/ - - $IN['act'] = $IN['act'] == '' ? "idx" : $IN['act']; - - // Check to make sure the array key exits.. - if (! isset($choice[$IN['act']]) ) { - $IN['act'] = 'idx'; - } - - // Require and run - - if ($IN['act'] == 'idx') - { - print $SKIN->frame_set(); - exit; - } - else if ($IN['act'] == 'menu') - { - $ADMIN->menu(); - } - else - { - require $root_path."sources/Admin/ad_".$choice[$IN['act']].".php"; - } - -} - - - -//+------------------------------------------------- -// GLOBAL ROUTINES -//+------------------------------------------------- - -function fatal_error($message="", $help="") { - echo("$message

    $help"); - exit; -} -?> + Admin wrapper script +| > Script written by Matt Mecham +| > Date started: 1st March 2002 +| ++-------------------------------------------------------------------------- +*/ + +/*----------------------------------------------- + USER CONFIGURABLE ELEMENTS + ------------------------------------------------*/ + +// Are we running this on a lycos / tripod server? +// If so, change the following to a 1. + +$is_on_tripod = 0; + +// Root path + +$root_path = "./"; + +// Check IP address to see if they match? +// this may cause problems for users on proxies +// where the IP address changes during a session + +$check_ip = 1; + +// Use GZIP content encoding for fast page generation +// in the admin center? + +$use_gzip = 1; + + +/*----------------------------------------------- + NO USER EDITABLE SECTIONS BELOW + ------------------------------------------------*/ + +error_reporting (E_ERROR | E_WARNING | E_PARSE); +set_magic_quotes_runtime(0); + +if ( $is_on_tripod != 1 ) +{ + if (function_exists('ini_get')) + { + $safe_switch = @ini_get("safe_mode") ? 1 : 0; + } + else + { + $safe_switch = 1; + } +} +else +{ + $safe_switch = 1; +} + +define( 'SAFE_MODE_ON', $safe_switch ); + +if (function_exists("set_time_limit") == 1 and SAFE_MODE_ON == 0) +{ + @set_time_limit(0); +} + + +class Debug { + function startTimer() { + global $starttime; + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $starttime = $mtime; + } + function endTimer() { + global $starttime; + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $endtime = $mtime; + $totaltime = round (($endtime - $starttime), 5); + return $totaltime; + } +} + +class info { + + var $vars = ""; + var $version = '1.0'; + + + function info($INFO) + { + //global $INFO; + $this->vars = $INFO; + } +} + + + +/*----------------------------------------------- + Import $INFO + ------------------------------------------------*/ + +require $root_path."conf_global.php"; + +$ibforums = new info($INFO); + +$Debug = new Debug; +$Debug->startTimer(); + +/*----------------------------------------------- + Make sure our data is reset on each invocation + ------------------------------------------------*/ +$MEMBER = array(); +$SESSION_ID = ""; +$SKIN = ""; + +// Put an end to insane thoughs before they begin +$MEMBER_NAME = ""; +$MEMBER_PASSWORD = ""; +$MEMBER_EMAIL = ""; +$UserName = ""; +$PassWord = ""; + + +/*----------------------------------------------- + Load up our classes (compiled into one package) + ------------------------------------------------*/ + +require $root_path."sources/functions.php"; + +$std = new FUNC; + +/*----------------------------------------------- + Steralize our FORM and GET input + ------------------------------------------------*/ + +$IN = $std->parse_incoming(); + +$IN['AD_SESS'] = $HTTP_POST_VARS['adsess'] ? $HTTP_POST_VARS['adsess'] : $HTTP_GET_VARS['adsess']; + +/*----------------------------------------------- + Import $PAGES and $CATS + ------------------------------------------------*/ + +require $root_path."sources/Admin/admin_pages.php"; + + +/*----------------------------------------------- + Import Skinable elements + ------------------------------------------------*/ + +require $root_path."sources/Admin/admin_skin.php"; + +$SKIN = new admin_skin(); + +/*----------------------------------------------- + Import Admin Functions + ------------------------------------------------*/ + +require $root_path."sources/Admin/admin_functions.php"; + +$ADMIN = new admin_functions(); + +/*----------------------------------------------- + Load up our database library + ------------------------------------------------*/ + +$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; + +$to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; +require ($to_require); + +$DB = new db_driver; + +$DB->obj['sql_database'] = $INFO['sql_database']; +$DB->obj['sql_user'] = $INFO['sql_user']; +$DB->obj['sql_pass'] = $INFO['sql_pass']; +$DB->obj['sql_host'] = $INFO['sql_host']; +$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; + +// Get a DB connection +$DB->connect(); + +//------------------------------------------------ +// Fix up the "show" ID's for the menu tree... +// +// show=1,4,5 holds the current ID's, clicking on a +// collapse link creates out=4 - "4" is then removed +// from the show link. +// +// Good eh? +//------------------------------------------------ + +if ($IN['show'] == 'none') +{ + $IN['show'] = ""; +} +else if ($IN['show'] == 'all') +{ + $IN['show'] = ""; + + foreach($CATS as $cid => $name) + { + $IN['show'] .= $cid.','; + } +} +else +{ + $IN['show'] = preg_replace( "/(?:^|,)".$IN['out']."(?:,|$)/", ",", $IN['show'] ); + $IN['show'] = preg_replace( "/,,/" , "" , $IN['show'] ); + $IN['show'] = preg_replace( "/,$/" , "" , $IN['show'] ); + $IN['show'] = preg_replace( "/^,/" , "" , $IN['show'] ); +} + + +//------------------------------------------------ +// Admin.php Rules: +// +// No adsess number? +// ----------------- +// +// Then we log into the admin CP +// +// Got adsess number? +// ------------------ +// +// Then we check the cookie "ad_login" for a session key. +// +// If this session key matches the one stored in the admin_sessions +// table, then we check the data against the data stored in the +// profiles table. +// +// The session key and ad_sess keys are generated each time we log in. +// +// If we don't have a valid adsess in the URL, then we ask for a log in. +// +//------------------------------------------------ + +$session_validated = 0; +$this_session = array(); + +$validate_login = 0; + +if ($IN['login'] != 'yes') { + + if ( (!$IN['adsess']) or (empty($IN['adsess'])) or (!isset($IN['adsess'])) or ($IN['adsess'] == "") ) + { + //---------------------------------- + // No URL adsess found, lets log in. + //---------------------------------- + + do_login("No administration session found"); + } + else + { + //---------------------------------- + // We have a URL adsess, lets verify... + //---------------------------------- + + $DB->query("SELECT * FROM ibf_admin_sessions WHERE ID='".$IN['adsess']."'"); + $row = $DB->fetch_row(); + + if ($row['ID'] == "") + { + //---------------------------------- + // Fail-safe, no DB record found, lets log in.. + //---------------------------------- + + do_login("Could not retrieve session record"); + } + else if ($row['MEMBER_ID'] == "") + { + + //---------------------------------- + // No member ID is stored, log in! + //---------------------------------- + + do_login("Could not retrieve a valid member id"); + + } + else + { + //---------------------------------- + // Key is good, check the member details + //---------------------------------- + + $DB->query("SELECT * FROM ibf_members WHERE id='".$row['MEMBER_ID']."'"); + $MEMBER = $DB->fetch_row(); + + if ($MEMBER['id'] == "") + { + + //---------------------------------- + // Ut-oh, no such member, log in! + //---------------------------------- + + do_login("Member ID invalid"); + + } + else + { + //---------------------------------- + // Member found, check passy + //---------------------------------- + + if ($row['SESSION_KEY'] != $MEMBER['password']) + { + //---------------------------------- + // Passys don't match.. + //---------------------------------- + + do_login("Session member password mismatch"); + + } + else + { + //---------------------------------- + // Do we have admin access? + //---------------------------------- + + $DB->query("SELECT * FROM ibf_groups WHERE g_id='".$MEMBER['mgroup']."'"); + + $GROUP = $DB->fetch_row(); + + if ($GROUP['g_access_cp'] != 1) + { + do_login("You do not have access to the administrative CP"); + } + else + { + $session_validated = 1; + $this_session = $row; + } + } + } + } + } +} +else +{ + //---------------------------------- + // We must have submitted the form + // time to check some details. + //---------------------------------- + + if ( empty($IN['username']) ) + { + do_login("You must enter a username before proceeding"); + } + + if ( empty($IN['password']) ) + { + do_login("You must enter a password before proceeding"); + } + + //---------------------------------- + // Attempt to get the details from the + // DB + //---------------------------------- + + $DB->query("SELECT name, password, id, mgroup FROM ibf_members WHERE LOWER(name)='".strtolower($IN['username'])."'"); + $mem = $DB->fetch_row(); + + if ( empty($mem['id']) ) + { + do_login("Could not find a record matching that username, please check the spelling"); + } + + $pass = md5( $IN['password'] ); + + if ($pass != $mem['password']) + { + do_login("The password entered did not match the one in our records"); + } + else + { + $DB->query("SELECT * FROM ibf_groups WHERE g_id='".$mem['mgroup']."'"); + + $GROUP = $DB->fetch_row(); + + if ($GROUP['g_access_cp'] != 1) + { + do_login("You do not have access to the administrative CP"); + } + else + { + + //---------------------------------- + // All is good, rejoice as we set a + // session for this user + //---------------------------------- + + $sess_id = md5( uniqid( microtime() ) ); + + $db_string = $DB->compile_db_insert_string( array ( + 'ID' => $sess_id, + 'IP_ADDRESS' => $IN['IP_ADDRESS'], + 'MEMBER_NAME' => $mem['name'], + 'MEMBER_ID' => $mem['id'], + 'SESSION_KEY' => $pass, + 'LOCATION' => 'index', + 'LOG_IN_TIME' => time(), + 'RUNNING_TIME' => time(), + ) ); + + $DB->query("INSERT INTO ibf_admin_sessions (".$db_string['FIELD_NAMES'].") VALUES (".$db_string['FIELD_VALUES'].")"); + + $IN['AD_SESS'] = $sess_id; + + // Print the "well done page" + + $ADMIN->page_title = "Log in successful"; + + $ADMIN->page_detail = "Taking you to the administrative control panel"; + + $ADMIN->html .= $SKIN->start_table("Proceed"); + + $ADMIN->html .= ""; + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + } + +} + + +//---------------------------------- +// Ok, so far so good. If we have a +// validate session, check the running +// time. if it's older than 2 hours, +// ask for a log in +//---------------------------------- + + +if ($session_validated == 1) +{ + if ($this_session['RUNNING_TIME'] < ( time() - 60*60*2) ) + { + $session_validated = 0; + do_login("This administration session has expired"); + } + + //------------------------------ + // Are we checking IP's? + //------------------------------ + + else if ($check_ip == 1) + { + if ($this_session['IP_ADDRESS'] != $IN['IP_ADDRESS']) + { + $session_validated = 0; + do_login("Your current IP address does not match the one in our records"); + } + } +} + +if ($session_validated == 1 ) +{ + //------------------------------ + // If we get this far, we're good to go.. + //------------------------------ + + $IN['AD_SESS'] = $IN['adsess']; + + //------------------------------ + // Lets update the sessions table: + //------------------------------ + + $DB->query("UPDATE ibf_admin_sessions SET RUNNING_TIME='".time()."', LOCATION='".$IN['act']."' WHERE MEMBER_ID='".$MEMBER['id']."' AND ID='".$IN['AD_SESS']."'"); + + do_admin_stuff(); + +} +else +{ + //------------------------------ + // Session is not validated... + //------------------------------ + + do_login("Session not validated - please attempt to log in again"); + +} + + + +function do_login($message="") { + global $IN, $DB, $ADMIN, $SKIN; + + //------------------------------------------------------- + // Remove all out of date sessions, like a good boy. Woof. + //------------------------------------------------------- + + $cut_off_stamp = time() - 60*60*2; + + $DB->query("DELETE FROM ibf_admin_sessions WHERE RUNNING_TIME < $cut_off_stamp"); + + //+------------------------------------------------------ + + $ADMIN->page_detail = "You must have administrative access to successfully log into the Invision Board Admin CP.
    Please enter your forums username and password below"; + + if ($message != "") + { + $ADMIN->page_detail .= "

    $message"; + } + + $ADMIN->html .= " + "; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array('login', 'yes') ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Verification Required" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Your Forums Username:", + "", + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Your Forums Password:", + "", + ) ); + + $ADMIN->html .= $SKIN->end_form("Log in"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + +} + + + + + +function do_admin_stuff() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; + + + /*---------------------------------- + What do you want to require today? + ------------------------------------*/ + + $choice = array( + "idx" => "doframes", + "menu" => "menu", + "index" => "index", + "cat" => "categories", + "forum" => "forums", + "mem" => "member", + 'group' => "groups", + 'mod' => 'moderator', + 'op' => 'settings', + 'help' => 'help', + 'skin' => 'skins', + 'wrap' => 'wrappers', + 'style' => 'stylesheets', + 'image' => 'imagemacros', + 'sets' => 'stylesets', + 'templ' => 'templates', + 'rtempl' => 'remote_template', + 'lang' => 'languages', + 'import' => 'skin_import', + 'modlog' => 'modlogs', + 'field' => 'profilefields', + 'stats' => "statistics", + 'quickhelp' => "quickhelp", + 'adminlog' => "adminlogs", + 'ips' => 'ips', + 'mysql' => 'mysql', + ); + + + /***************************************************/ + + $IN['act'] = $IN['act'] == '' ? "idx" : $IN['act']; + + // Check to make sure the array key exits.. + if (! isset($choice[$IN['act']]) ) { + $IN['act'] = 'idx'; + } + + // Require and run + + if ($IN['act'] == 'idx') + { + print $SKIN->frame_set(); + exit; + } + else if ($IN['act'] == 'menu') + { + $ADMIN->menu(); + } + else + { + require $root_path."sources/Admin/ad_".$choice[$IN['act']].".php"; + } + +} + + + +//+------------------------------------------------- +// GLOBAL ROUTINES +//+------------------------------------------------- + +function fatal_error($message="", $help="") { + echo("$message

    $help"); + exit; +} +?> diff --git a/upload/html/ibfcode.js b/upload/html/ibfcode.js index 82b872de..7390730d 100644 --- a/upload/html/ibfcode.js +++ b/upload/html/ibfcode.js @@ -1 +1 @@ -bbtags = new Array(); //-------------------------------------------- // Get stack size //-------------------------------------------- function stacksize(thearray) { for (i = 0 ; i < thearray.length; i++ ) { if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) { return i; } } return thearray.length; } //-------------------------------------------- // Push stack //-------------------------------------------- function pushstack(thearray, newval) { arraysize = stacksize(thearray); thearray[arraysize] = newval; } //-------------------------------------------- // Pop stack //-------------------------------------------- function popstack(thearray) { arraysize = stacksize(thearray); theval = thearray[arraysize - 1]; delete thearray[arraysize - 1]; return theval; } //-------------------------------------------- // Close current open tag //-------------------------------------------- function closelast() { if (bbtags[0]) { document.REPLIER.Post.value += "[/" + popstack(bbtags) + "]"; } document.REPLIER.Post.focus(); } //-------------------------------------------- // Close all tags //-------------------------------------------- function closeall() { if (bbtags[0]) { while (bbtags[0]) { document.REPLIER.Post.value += "[/" + popstack(bbtags) + "]"; } document.REPLIER.Post.value += " "; } document.REPLIER.Post.focus(); } //-------------------------------------------- // EMOTICONS //-------------------------------------------- function emoticon(theSmilie) { if (document.REPLIER.Post.caretPos && document.REPLIER.Post.createTextRange) { var caretPos = document.REPLIER.Post.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie; } else { document.REPLIER.Post.value += ' ' + theSmilie + ' '; } document.REPLIER.Post.focus(); } //-------------------------------------------- // ADD CODE //-------------------------------------------- function add_code(NewCode) { document.REPLIER.Post.value += NewCode; document.REPLIER.Post.focus(); return; } //-------------------------------------------- // ALTER FONT //-------------------------------------------- function alterfont(theval, thetag) { if (theval == 0) { return; } else { document.REPLIER.Post.value += "[" + thetag + "=" + theval + "]"; pushstack(bbtags, thetag); } document.REPLIER.ffont.selectedIndex = 0; document.REPLIER.fsize.selectedIndex = 0; document.REPLIER.fcolor.selectedIndex = 0; document.REPLIER.Post.focus(); } //-------------------------------------------- // SIMPLE TAGS (such as B, I U, etc) //-------------------------------------------- function simpletag(thetag) { document.REPLIER.Post.value += "[" + thetag + "]"; pushstack(bbtags, thetag); document.REPLIER.Post.focus(); } function tag_url() { var FoundErrors = ''; var enterURL = prompt(text_enter_url, "http://"); var enterTITLE = prompt(text_enter_url_name, "My Webpage"); if (!enterURL) { FoundErrors += " " + error_no_url; } if (!enterTITLE) { FoundErrors += " " + error_no_title; } if (FoundErrors) { alert("Error!"+FoundErrors); return; } var ToAdd = "[URL="+enterURL+"]"+enterTITLE+"[/URL]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } function tag_image() { var FoundErrors = ''; var enterURL = prompt(text_enter_image, "http://"); if (!enterURL) { FoundErrors += " " + error_no_url; } if (FoundErrors) { alert("Error!"+FoundErrors); return; } var ToAdd = "[IMG]"+enterURL+"[/IMG]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } function tag_email() { var emailAddress = prompt(text_enter_email,""); if (!emailAddress) { alert(error_no_email); return; } var ToAdd = "[EMAIL]"+emailAddress+"[/EMAIL]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } \ No newline at end of file +//-------------------------------------------- // Set up our simple tag open values //-------------------------------------------- var B_open = 0; var I_open = 0; var U_open = 0; var QUOTE_open = 0; var CODE_open = 0; var SQL_open = 0; var HTML_open = 0; var bbtags = new Array(); // Set the initial radio button status based on cookies var allcookies = document.cookie; var pos = allcookies.indexOf("bbmode="); prep_mode(); function prep_mode() { if (pos != 1) { var cstart = pos + 7; var cend = allcookies.indexOf(";", cstart); if (cend == -1) { cend = allcookies.length; } cvalue = allcookies.substring(cstart, cend); if (cvalue == 'ezmode') { document.REPLIER.bbmode[0].checked = true; } else { document.REPLIER.bbmode[1].checked = true; } } else { // default to normal mode. document.REPLIER.bbmode[1].checked = true; } } function setmode(mVal) { document.cookie = "bbmode="+mVal+"; path=/; expires=Wed, 1 Jan 2020 00:00:00 GMT;"; } function get_easy_mode_state() { // Returns true if we've chosen easy mode if (document.REPLIER.bbmode[0].checked) { return true; } else { return false; } } //-------------------------------------------- // Set the help bar status //-------------------------------------------- function hstat(msg) { document.REPLIER.helpbox.value = eval( "help_" + msg ); } // Set the number of tags open box function cstat() { var c = stacksize(bbtags); if ( (c < 1) || (c == null) ) { c = 0; } if ( ! bbtags[0] ) { c = 0; } document.REPLIER.tagcount.value = c; } //-------------------------------------------- // Get stack size //-------------------------------------------- function stacksize(thearray) { for (i = 0 ; i < thearray.length; i++ ) { if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) { return i; } } return thearray.length; } //-------------------------------------------- // Push stack //-------------------------------------------- function pushstack(thearray, newval) { arraysize = stacksize(thearray); thearray[arraysize] = newval; } //-------------------------------------------- // Pop stack //-------------------------------------------- function popstack(thearray) { arraysize = stacksize(thearray); theval = thearray[arraysize - 1]; delete thearray[arraysize - 1]; return theval; } //-------------------------------------------- // Close all tags //-------------------------------------------- function closeall() { if (bbtags[0]) { while (bbtags[0]) { tagRemove = popstack(bbtags) document.REPLIER.Post.value += "[/" + tagRemove + "]"; // Change the button status eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '"); eval(tagRemove + "_open = 0"); } } // Ensure we got them all document.REPLIER.tagcount.value = 0; bbtags = new array(); document.REPLIER.Post.focus(); } //-------------------------------------------- // EMOTICONS //-------------------------------------------- function emoticon(theSmilie) { if (document.REPLIER.Post.caretPos && document.REPLIER.Post.createTextRange) { var caretPos = document.REPLIER.Post.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie; } else { document.REPLIER.Post.value += ' ' + theSmilie + ' '; } document.REPLIER.Post.focus(); } //-------------------------------------------- // ADD CODE //-------------------------------------------- function add_code(NewCode) { document.REPLIER.Post.value += NewCode; document.REPLIER.Post.focus(); return; } //-------------------------------------------- // ALTER FONT //-------------------------------------------- function alterfont(theval, thetag) { if (theval == 0) { return; } else { document.REPLIER.Post.value += "[" + thetag + "=" + theval + "] [/" + thetag + "]"; } document.REPLIER.ffont.selectedIndex = 0; document.REPLIER.fsize.selectedIndex = 0; document.REPLIER.fcolor.selectedIndex = 0; document.REPLIER.Post.focus(); } //-------------------------------------------- // SIMPLE TAGS (such as B, I U, etc) //-------------------------------------------- function simpletag(thetag) { var tagOpen = eval(thetag + "_open"); if ( get_easy_mode_state() ) { inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]"); if ( (inserttext != null) && (inserttext != "") ) { document.REPLIER.Post.value += "[" + thetag + "]" + inserttext + "[/" + thetag + "] "; } } else { if (tagOpen == 0) { document.REPLIER.Post.value += "[" + thetag + "]"; eval(thetag + "_open = 1"); // Change the button status eval("document.REPLIER." + thetag + ".value += '*'"); pushstack(bbtags, thetag); cstat(); hstat('click_close'); } else { // Find the last occurance of the opened tag lastindex = 0; for (i = 0 ; i < bbtags.length; i++ ) { if ( bbtags[i] == thetag ) { lastindex = i; } } // Close all tags opened up to that tag was opened while (bbtags[lastindex]) { tagRemove = popstack(bbtags); document.REPLIER.Post.value += "[/" + tagRemove + "]"; // Change the button status eval("document.REPLIER." + tagRemove + ".value = ' " + tagRemove + " '"); eval(tagRemove + "_open = 0"); } cstat(); } } document.REPLIER.Post.focus(); } function tag_list() { listvalue = "init"; thelist = "[LIST]\n"; while ( (listvalue != "") && (listvalue != null) ) { listvalue = prompt(list_prompt, ""); if ( (listvalue != "") && (listvalue != null) ) { thelist = thelist+"[*]"+listvalue+"\n"; } } document.REPLIER.Post.value += thelist + "[/LIST]\n"; document.REPLIER.Post.focus(); } function tag_url() { var FoundErrors = ''; var enterURL = prompt(text_enter_url, "http://"); var enterTITLE = prompt(text_enter_url_name, "My Webpage"); if (!enterURL) { FoundErrors += " " + error_no_url; } if (!enterTITLE) { FoundErrors += " " + error_no_title; } if (FoundErrors) { alert("Error!"+FoundErrors); return; } var ToAdd = "[URL="+enterURL+"]"+enterTITLE+"[/URL]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } function tag_image() { var FoundErrors = ''; var enterURL = prompt(text_enter_image, "http://"); if (!enterURL) { FoundErrors += " " + error_no_url; } if (FoundErrors) { alert("Error!"+FoundErrors); return; } var ToAdd = "[IMG]"+enterURL+"[/IMG]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } function tag_email() { var emailAddress = prompt(text_enter_email,""); if (!emailAddress) { alert(error_no_email); return; } var ToAdd = "[EMAIL]"+emailAddress+"[/EMAIL]"; document.REPLIER.Post.value+=ToAdd; document.REPLIER.Post.focus(); } \ No newline at end of file diff --git a/upload/html/sys-img/.DS_Store b/upload/html/sys-img/.DS_Store deleted file mode 100644 index c7c6790c..00000000 Binary files a/upload/html/sys-img/.DS_Store and /dev/null differ diff --git a/upload/html/sys-img/bar.gif b/upload/html/sys-img/bar.gif new file mode 100644 index 00000000..fe373dad Binary files /dev/null and b/upload/html/sys-img/bar.gif differ diff --git a/upload/html/sys-img/bar_left.gif b/upload/html/sys-img/bar_left.gif new file mode 100644 index 00000000..7be171e4 Binary files /dev/null and b/upload/html/sys-img/bar_left.gif differ diff --git a/upload/html/sys-img/bar_right.gif b/upload/html/sys-img/bar_right.gif new file mode 100644 index 00000000..e31d1428 Binary files /dev/null and b/upload/html/sys-img/bar_right.gif differ diff --git a/upload/html/sys-img/css.html b/upload/html/sys-img/css.html index 70224e1d..bb7e4138 100644 --- a/upload/html/sys-img/css.html +++ b/upload/html/sys-img/css.html @@ -1 +1 @@ -CSS GeneratorSimple CSS Generator

    This is designed to generate a simple CSS definition. It does not contain all the CSS attributes, just the most commonly used ones.

    + + + + + + + + + + + + + + + + + + + +EOF; +} + +function settings_header($Profile, $time_select, $time, $dst_check) { +global $ibforums; +return << + + + + + + + + + + + + + + + + + +EOF; +} + +function skin_lang_header($lang_select) { +global $ibforums; +return << + + + +
    + + + + +
    + + + + + +EOF; +} + +function settings_skin($skin) { +global $ibforums; +return << + + + + + + +EOF; +} + +function skin_lang_end() { +global $ibforums; +return << + + +EOF; +} + +function settings_end($data) { +global $ibforums; +return << + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +} + +function email($Profile) { +global $ibforums; +return << + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +} + +function forum_subs_header() { +global $ibforums; +return <<{$ibforums->lang['forum_subs_header']} + + + + +EOF; +} + +function subs_header() { +global $ibforums; +return << + + + + + + + +EOF; +} + +function forum_jump($data, $menu_extra="") { +global $ibforums; +return << + + +
    +
    + + + + + + + + + + +EOF; +} + +function active_none() { +global $ibforums; +return << +EOF; +} + + +} ?> \ No newline at end of file diff --git a/upload/Skin/s1/skin_stats.php b/upload/Skin/s1/skin_stats.php index aaca7842..4c427adb 100644 --- a/upload/Skin/s1/skin_stats.php +++ b/upload/Skin/s1/skin_stats.php @@ -3,13 +3,77 @@ class skin_stats { +function who_header($fid, $tid, $title) { +global $ibforums; +return << + + +
     {$ibforums->lang['h_topic_title']}{$ibforums->lang['h_forum_name']}{$ibforums->lang['h_topic_starter']}{$ibforums->lang['h_replies']}{$ibforums->lang['h_hits']}{$ibforums->lang['h_last_action']}
    {$ibforums->lang['active_no_topics']}
    + + + +
    + + + + + + + + +EOF; +} + + +function who_row($row) { +global $ibforums; +return << + + + +EOF; +} + +function who_name_link($id, $name) { +global $ibforums; +return <<$name + +EOF; +} + + +function who_end() { +global $ibforums; +return << + + +
    {$ibforums->lang['who_farted']} $title
    {$ibforums->lang['who_poster']}{$ibforums->lang['who_posts']}
    {$row['author_name']}{$row['pcount']}
    {$ibforums->lang['who_go']}
    +
    +EOF; +} + + function page_title($title) { global $ibforums; return << + - +
    {$title}{$title}
    EOF; @@ -18,18 +82,18 @@ EOF; function group_strip( $group ) { global $ibforums; return << + + + +EOF; +} + +function email_change($txt="") { +global $ibforums; +return <<{$ibforums->lang['change_email_title']} + + +
    + + + +
    + + + + + + + + + + + + + + +EOF; +} + +function pass_change() { +global $ibforums; +return << + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +} + +function personal_splash() { +global $ibforums; +return <<{$ibforums->lang['personal_ops']} + + + + + + + +EOF; +} + +function member_title($title) { +global $ibforums; +return << + + + +EOF; +} + +function personal_avatar($data, $formextra="", $hidden_field="") { +global $ibforums; +return << + + + +
    vars['php_ext']}' method='post' onload='checkTheBox' $formextra name='creator'> + + + + $hidden_field + +
    + + + + + + + + + + + +EOF; +} + +function avatar_upload_field($text="") { +global $ibforums; +return << + + + +EOF; +} + +function personal_avatar_URL($Profile, $avatar, $allowed_ext) { +global $ibforums; +return << + + + + + + + + + + + +EOF; +} + +function personal_avatar_end() { +global $ibforums; +return << + + + + + + + + + +EOF; +} + +function personal_splash_av() { +global $ibforums; +return << + + +EOF; +} + +function signature($sig, $t_sig) { +global $ibforums; +return << + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + +EOF; +} + +function personal_panel($Profile) { +global $ibforums; +return << + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF; +} + +function required_title() { +global $ibforums; +return <<{$ibforums->lang['cf_required']} + + +EOF; +} + +function field_entry($title, $desc="", $content) { +global $ibforums; +return << + + + +EOF; +} + +function field_textinput($name, $value="") { +global $ibforums; +return << +EOF; +} + +function field_dropdown($name, $options) { +global $ibforums; +return <<$options +EOF; +} + +function field_textarea($name, $value) { +global $ibforums; +return <<$value +EOF; +} + + +function Menu_bar($base_url) { +global $ibforums; +return << +
    - + - - - - + + + + EOF; } @@ -38,10 +102,10 @@ function leader_row($info, $forums) { global $ibforums; return << - - - - + + + + EOF; } @@ -60,16 +124,16 @@ EOF; function top_poster_header() { global $ibforums; return << +
    $group$group
    {$ibforums->lang['leader_name']}{$ibforums->lang['leader_forums']}{$ibforums->lang['leader_location']} {$ibforums->lang['leader_name']}{$ibforums->lang['leader_forums']}{$ibforums->lang['leader_location']} 
    {$info['name']}$forums{$info['location']}{$info['msg_icon']}{$info['name']}$forums{$info['location']}{$info['msg_icon']}
    @@ -104,7 +168,7 @@ function top_poster_no_info() { global $ibforums; return << - + EOF; } diff --git a/upload/Skin/s1/skin_topic.php b/upload/Skin/s1/skin_topic.php index 5e4f6685..a159b247 100644 --- a/upload/Skin/s1/skin_topic.php +++ b/upload/Skin/s1/skin_topic.php @@ -3,25 +3,17 @@ class skin_topic { - -function mod_cp_link($data) { -global $ibforums; -return <<vars['php_ext']}?s={$ibforums->session_id}&act=ModCP&f=$data'>{$ibforums->lang['mod_cp']} ) -EOF; -} - function report_link($data) { global $ibforums; return <<vars['php_ext']}?s={$ibforums->session_id}&act=Report&f={$data[FORUM_ID]}&t={$data[TOPIC_ID]}&p={$data[POST_ID]}'>{$ibforums->lang['snitch_geezer_to_a_copper']} +input['st']}'>{$ibforums->lang['snitch_geezer_to_a_copper']} EOF; } function ip_show($data) { global $ibforums; return <<lang['ip']}: $data +{$ibforums->lang['ip']}: $data EOF; } @@ -32,28 +24,25 @@ return << -
    - - - - - + + + + + EOF; } @@ -78,11 +142,11 @@ function top_poster_row($info) { global $ibforums; return << - - - - - + + + + + EOF; } @@ -91,7 +155,7 @@ function top_poster_footer($info) { global $ibforums; return << - +
    {$ibforums->lang['member']}{$ibforums->lang['member_joined']}{$ibforums->lang['member_posts']}{$ibforums->lang['member_today']}{$ibforums->lang['member_percent']}{$ibforums->lang['member']}{$ibforums->lang['member_joined']}{$ibforums->lang['member_posts']}{$ibforums->lang['member_today']}{$ibforums->lang['member_percent']}
    {$info['name']}{$info['joined']}{$info['posts']}{$info['tpost']}{$info['today_pct']}%{$info['name']}{$info['joined']}{$info['posts']}{$info['tpost']}{$info['today_pct']}%
    {$ibforums->lang['total_today']} $info{$ibforums->lang['total_today']} $info
    {$ibforums->lang['no_info']}{$ibforums->lang['no_info']}
    + + vars['php_ext']}'> - + $data -   - - +   + EOF; } @@ -70,16 +59,17 @@ return << - - - + - - + - - + - + EOF; @@ -185,35 +200,36 @@ return << -
    - + + + +
    + + - @@ -88,65 +78,90 @@ return <<
    + - +
    {$ibforums->lang['topic_stats']}vars['php_ext']}?s={$ibforums->session_id}&act=Track&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['track_topic']} | - vars['php_ext']}?s={$ibforums->session_id}&act=Forward&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['forward']} | - vars['php_ext']}?s={$ibforums->session_id}&act=Print&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['print']}{$ibforums->lang['track_topic']} | + {$ibforums->lang['forward']} | + {$ibforums->lang['print']}
    - +
    - - + +
    {$data[TOPIC][SHOW_PAGES]}
    vars['php_ext']}?s={$ibforums->session_id}&act=SF&f={$data['FORUM']['id']}'>Back to {$data['FORUM']['name']}
    {$data[TOPIC][REPLY_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM]['id']}' title='{$ibforums->lang['start_new_topic']}'>{$ibforums->skin['A_POST']}{$data[TOPIC][POLL_BUTTON]}{$data[TOPIC][SHOW_PAGES]} +
    << vars['php_ext']}?s={$ibforums->session_id}&act=SF&f={$data['FORUM']['id']}'>Back to {$data['FORUM']['name']}
    {$data[TOPIC][REPLY_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM]['id']}' title='{$ibforums->lang['start_new_topic']}'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}

    - - - +
    {$data[FORUM]['JUMP']}
    + + +
    + + {$data[FORUM]['JUMP']}


    EOF; } + +function email_options($tid, $fid) { +global $ibforums; +return << +
    + {$ibforums->lang['tt_title']} +
    {$ibforums->lang['tt_desc']} +

    + {$ibforums->lang['ft_title']} +
    {$ibforums->lang['ft_desc']} +

    + {$ibforums->lang['av_title']} +
    {$ibforums->lang['av_desc']} +
    +EOF; +} + function RenderRow($data) { global $ibforums; return <<
    {$data[POSTER]['name']} + {$data[POSTER]['name']} - - + +
    {$data[POST]['post_icon']}{$ibforums->lang['posted_on']} {$data[POST]['post_date']}{$data[POST]['delete_button']}{$data[POST]['edit_button']}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=06&f={$ibforums->input[f]}&t={$ibforums->input[t]}&p={$data[POST]['pid']}'>{$ibforums->skin['P_QUOTE']}{$data[POST]['post_icon']}{$ibforums->lang['posted_on']} {$data[POST]['post_date']}{$data[POST]['delete_button']}{$data[POST]['edit_button']}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=06&f={$ibforums->input[f]}&t={$ibforums->input[t]}&p={$data[POST]['pid']}'><{P_QUOTE}>
    - {$data[POSTER]['avatar']}

    +
    + {$data[POSTER]['avatar']}

    {$data[POSTER]['title']}
    {$data[POSTER]['member_rank_img']}

    {$data[POSTER]['member_group']}
    {$data[POSTER]['member_posts']}
    {$data[POSTER]['member_number']}
    {$data[POSTER]['member_joined']}
    - {$data[POSTER][WARN_GFX]}

    + {$data[POSTER][WARN_GFX]}


    {$data[POST]['post']} {$data[POST]['attachment']} {$data[POST]['signature']}{$data[POST]['post']} {$data[POST]['attachment']} {$data[POST]['signature']}
      + {$data[POST]['ip_address']}  - - - + + +
    {$data[POSTER]['message_icon']}{$data[POSTER]['email_icon']}{$data[POSTER]['website_icon']}{$data[POSTER]['icq_icon']}{$data[POSTER]['aol_icon']}{$data[POSTER]['yahoo_icon']}{$data[POSTER]['msn_icon']}{$data[POST]['ip_address']}{$data[POST]['report_link']}Top{$data[POSTER]['message_icon']}{$data[POSTER]['email_icon']}{$data[POSTER]['website_icon']}{$data[POSTER]['icq_icon']}{$data[POSTER]['aol_icon']}{$data[POSTER]['yahoo_icon']}{$data[POSTER]['msn_icon']}{$data[POST]['report_link']} Top
    +
    - +
    {$data['TOPIC']['SHOW_PAGES']} {$data['TOPIC']['go_new']}{$data[TOPIC][REPLY_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM]['id']}' title='{$ibforums->lang['start_new_topic']}'>{$ibforums->skin['A_POST']}{$data[TOPIC][POLL_BUTTON]}{$data[TOPIC][REPLY_BUTTON]}vars['php_ext']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM]['id']}' title='{$ibforums->lang['start_new_topic']}'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}
    - +
    - - - - - - - - - - - - - - - - - - -EOF; -} - -function settings_header($Profile, $time_select, $time, $dst_check) { -global $ibforums; -return << - - - - - - - - - - - - - - - - - -EOF; -} - -function skin_lang_header($lang_select) { -global $ibforums; -return << - - - -
    - - - - -
    - - - - - -EOF; -} - -function settings_skin($skin) { -global $ibforums; -return << - - - - - - -EOF; -} - -function skin_lang_end() { -global $ibforums; -return << - - -EOF; -} - -function settings_end($data) { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function email($Profile) { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function subs_header() { -global $ibforums; -return << - - - - - - - -EOF; -} - -function forum_jump($data, $menu_extra="") { -global $ibforums; -return << - - -
    -
    + - +
    {$data['TOPIC']['title']}{$data['TOPIC']['description']}{$data['TOPIC']['title']}{$data['TOPIC']['description']}
    + + - @@ -223,11 +239,28 @@ return << + + + + + + +
    + + vars['php_ext']}?s={$ibforums->session_id}&act=Print&client=printer&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['print']}
    « vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM]['id']}&t={$data[TOPIC]['tid']}&view=old'>{$ibforums->lang['t_old']} | vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM]['id']}&t={$data[TOPIC]['tid']}&view=new'>{$ibforums->lang['t_new']} » vars['php_ext']}?s={$ibforums->session_id}&act=Track&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['track_topic']} | vars['php_ext']}?s={$ibforums->session_id}&act=Forward&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['forward']} | - vars['php_ext']}?s={$ibforums->session_id}&act=Print&f={$data['FORUM']['id']}&t={$data['TOPIC']['tid']}'>{$ibforums->lang['print']}
    {$ibforums->lang['active_users_title']} ({$ibforums->lang['active_users_detail']})
    {$ibforums->lang['active_users_members']} {$active['names']}
    + + +EOF; +} + function Show_attachments_img($data) { global $ibforums; return <<
    {$ibforums->lang['pic_attach']}

    - +
    @@ -240,7 +273,7 @@ function Show_attachments($data) { global $ibforums; return <<
    -
    {$ibforums->lang[
    +
    diff --git a/upload/Skin/s1/skin_ucp.php b/upload/Skin/s1/skin_ucp.php index 3f095e69..956ea470 100644 --- a/upload/Skin/s1/skin_ucp.php +++ b/upload/Skin/s1/skin_ucp.php @@ -1,919 +1,1098 @@ - - - - -EOF; -} - -function email_change($txt="") { -global $ibforums; -return <<{$ibforums->lang['change_email_title']} - - -
    - - - -
    - - - - - - - - - - - - - - -EOF; -} - -function pass_change() { -global $ibforums; -return << - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function personal_splash() { -global $ibforums; -return <<{$ibforums->lang['personal_ops']} - - - - - - - -EOF; -} - -function member_title($title) { -global $ibforums; -return << - - - -EOF; -} - -function personal_avatar($data, $formextra="", $hidden_field="") { -global $ibforums; -return << - - - -
    vars['php_ext']}' method='post' onload='checkTheBox' $formextra name='creator'> - - - - $hidden_field - -
    - - - - - - - - - - - -EOF; -} - -function avatar_upload_field($text="") { -global $ibforums; -return << - - - -EOF; -} - -function personal_avatar_URL($Profile, $avatar, $allowed_ext) { -global $ibforums; -return << - - - - - - - - - - - -EOF; -} - -function personal_avatar_end() { -global $ibforums; -return << - - - - - - - - - -EOF; -} - -function personal_splash_av() { -global $ibforums; -return << - - -EOF; -} - -function signature($sig, $t_sig) { -global $ibforums; -return << - - - - -
    - - - -
    - - - - - - - - - - - - - - - - - -EOF; -} - -function personal_panel($Profile) { -global $ibforums; -return << - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; -} - -function Menu_bar($base_url) { -global $ibforums; -return << -
    User Attached Image vars['php_ext']}?s={$ibforums->session_id}&act=Attach&type=post&id={$data['pid']}' target='_blank'>{$ibforums->lang['attach_dl']}{$ibforums->lang['birthday']} - - - -
    $txt
    {$ibforums->lang['ce_new_email']}
    {$ibforums->lang['ce_new_email2']}
    {$ibforums->lang['account_pass_title']}
    {$ibforums->lang['pass_change_text']}
    {$ibforums->lang['account_pass_old']}
    {$ibforums->lang['account_pass_new']}
    {$ibforums->lang['account_pass_new2']}
    {$ibforums->member['name']}, {$ibforums->lang['personal_ops_txt']}
    vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=2'>{$ibforums->lang['edit_profile']}

    {$ibforums->lang['edit_profile_txt']}
    {$ibforums->lang['member_title']}
    {$ibforums->lang['av_current']}
    {$ibforums->lang['this_avatar']}{$data[CUR_AV]}
    {$ibforums->lang['avatar_pre_title']}
    {$ibforums->lang['avatar_pre_txt']}{$data[AVATARS]}     {$data[SHOW_AVS]}
    {$ibforums->lang['upload_avatar']}
    $text
    {$ibforums->lang['avatar_url_title']}
    {$ibforums->lang['avatar']}
    {$ibforums->lang['avatar_url_ext']}
    $allowed_ext
    {$ibforums->lang['avatar_dims']}
    {$ibforums->lang['maximum']} {$ibforums->lang['width']} = {$ibforums->vars['av_width']} {$ibforums->lang['pixels']}
    {$ibforums->lang['maximum']} {$ibforums->lang['height']} = {$ibforums->vars['av_height']} {$ibforums->lang['pixels']})
    {$ibforums->lang['width']}     x   {$ibforums->lang['height']}  
    {$ibforums->lang['av_tt_one']}
    {$ibforums->lang['av_tt_two']}
    vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=1'>{$ibforums->lang['avatar_ops']}

    {$ibforums->lang['avatar_ops_txt']}
    {$ibforums->lang['cp_current_sig']}
    - - - - -
    $sig
    -
    {$ibforums->lang['cp_edit_sig']}
    - - - - - - - - - -
    - - - - - - Close Current Tag
    - - - - - - - - - Close All Tags -
    -

    ({$ibforums->lang['check_length']})
    {$ibforums->lang['profile_title']}
    {$ibforums->lang['website']}
    {$ibforums->lang['icq']}
    {$ibforums->lang['aol']}
    {$ibforums->lang['yahoo']}
    {$ibforums->lang['msn']}
    {$ibforums->lang['location']}
    ({$ibforums->lang['check_length']})
    {$ibforums->lang['interests']}
    ({$ibforums->lang['check_length']})
    - -
    - - - - - - -
    -   -
    - - - - - - - - - -
      
    - - - - -
    - - - {$ibforums->lang['m_messenger']}
    -
    - • {$ibforums->lang['mess_new']}
    - • {$ibforums->lang['mess_contact']}
    - • {$ibforums->lang['mess_folders']}
    - • {$ibforums->lang['mess_inbox']}
    - • {$ibforums->lang['mess_archive']}
    -
    - - - {$ibforums->lang['m_personal']}
    -
    - • {$ibforums->lang['m_contact_info']}
    - - • {$ibforums->lang['m_sig_info']}
    - • {$ibforums->lang['m_avatar_info']}
    - - - -
    - {$ibforums->lang['m_options']}
    -
    - • {$ibforums->lang['m_email_opt']}
    - • {$ibforums->lang['m_board_opt']}
    - • {$ibforums->lang['m_skin_lang']}
    - • {$ibforums->lang['m_email_change']}
    - • {$ibforums->lang['m_passy_opt']}
    - - -
    - {$ibforums->lang['m_tracker']}
    -
    - • {$ibforums->lang['m_view_subs']} -
    -
    - - - - -EOF; -} - -function CP_end() { -global $ibforums; -return << - -
    -
    -
    -EOF; -} - -function splash($member) { -global $ibforums; -return <<{$ibforums->lang['stats_header']}
    - - - - - - - - - - - - - - - - - -
    {$ibforums->lang['email_address']}{$member[MEMBER_EMAIL]}
    {$ibforums->lang['number_posts']}{$member[MEMBER_POSTS]}
    {$ibforums->lang['registered']}{$member[DATE_REGISTERED]}
    {$ibforums->lang['daily_average']}{$member[DAILY_AVERAGE]}
    -
    {$ibforums->lang['messenger_summary']}
    - - - - - - - - - -
    {$ibforums->lang['total_messages']}{$member['total_messages']} {$member['full_percent']}
    {$ibforums->lang['messages_left']}{$member['space_free']} {$member['full_messenger']}
    -
    {$ibforums->lang['note_pad']}
    -
    - - - - - - - -
    - -
    -
    - - - - - -
    {$ibforums->lang['ta_size']}  - - -
    -
    -
    {$ibforums->lang['settings_time']}
    {$ibforums->lang['settings_time_txt']}
    $time
    $time_select
    {$ibforums->lang['dst_box']}
    {$ibforums->lang['settings_title']}
    {$ibforums->lang['settings_lang_txt']}$lang_select
    {$ibforums->lang['settings_skin']}
    {$ibforums->lang['settings_skin_txt']}$skin   
    {$ibforums->lang['settings_display']}
    {$ibforums->lang['settings_viewsig']}{$data[SIG]}
    {$ibforums->lang['settings_viewimg']}{$data[IMG]}
    {$ibforums->lang['settings_viewava']}{$data[AVA]}
    {$ibforums->lang['settings_dopopup']}{$data[POP]}
    {$ibforums->lang['hide_session_txt']}{$data[SESS]}
    {$ibforums->lang['privacy_settings']}
    {$ibforums->lang['hide_email']}
    {$ibforums->lang['admin_send']}
    {$ibforums->lang['board_prefs']}
    {$ibforums->lang['send_full_msg']}
    - -
    {$ibforums->lang['subs_header']} -
    - - - -
    - - - - - - - - - -EOF; -} - -function subs_row($data) { -global $ibforums; -return << - - - - - - - -EOF; -} - -function subs_end() { -global $ibforums; -return << - - - -
     {$ibforums->lang['subs_topic']}{$ibforums->lang['subs_replies']}{$ibforums->lang['subs_view']}{$ibforums->lang['subs_last_post']}
    {$data['folder_icon']}vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data['forum_id']}&t={$data['tid']}'>{$data['title']} ( vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data['forum_id']}&t={$data['tid']}' target='_blank'>{$ibforums->lang['new_window']} )
    {$data['description']}{$ibforums->lang['subs_start']} {$data['start_date']}
    {$data['posts']}{$data['views']}{$data['last_post_date']}
    {$ibforums->lang['subs_by']} {$data['last_poster']}
      {$ibforums->lang['with_selected']}
    - - - - -
    -
    - -
    -
    {$data}
    -
    -EOF; -} - - -} + +
    {$ibforums->lang['birthday']} + + + +
    $txt
    {$ibforums->lang['ce_new_email']}
    {$ibforums->lang['ce_new_email2']}
    {$ibforums->lang['account_pass_title']}
    {$ibforums->lang['pass_change_text']}
    {$ibforums->lang['account_pass_old']}
    {$ibforums->lang['account_pass_new']}
    {$ibforums->lang['account_pass_new2']}
    {$ibforums->member['name']}, {$ibforums->lang['personal_ops_txt']}
    vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=2'>{$ibforums->lang['edit_profile']}

    {$ibforums->lang['edit_profile_txt']}
    {$ibforums->lang['member_title']}
    {$ibforums->lang['av_current']}
    {$ibforums->lang['this_avatar']}{$data[CUR_AV]}
    {$ibforums->lang['avatar_pre_title']}
    {$ibforums->lang['avatar_pre_txt']}{$data[AVATARS]}     {$data[SHOW_AVS]}
    {$ibforums->lang['upload_avatar']}
    $text
    {$ibforums->lang['avatar_url_title']}
    {$ibforums->lang['avatar']}
    {$ibforums->lang['avatar_url_ext']}
    $allowed_ext
    {$ibforums->lang['avatar_dims']}
    {$ibforums->lang['maximum']} {$ibforums->lang['width']} = {$ibforums->vars['av_width']} {$ibforums->lang['pixels']}
    {$ibforums->lang['maximum']} {$ibforums->lang['height']} = {$ibforums->vars['av_height']} {$ibforums->lang['pixels']})
    {$ibforums->lang['width']}     x   {$ibforums->lang['height']}  
    {$ibforums->lang['av_tt_one']}
    {$ibforums->lang['av_tt_two']}
    vars['php_ext']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=1'>{$ibforums->lang['avatar_ops']}

    {$ibforums->lang['avatar_ops_txt']}
    {$ibforums->lang['cp_current_sig']}
    + + + + +
    $sig
    +
    {$ibforums->lang['cp_edit_sig']}
    +  {$ibforums->lang['bbcode_guided']}
    +  {$ibforums->lang['bbcode_normal']} +
    + + + + + + + + + + + +
    + + + + + +   {$ibforums->lang['js_close_all_tags']} +
    + + + + + + + +
    + +
    + {$ibforums->lang['hb_open_tags']}:  +
    +

    ({$ibforums->lang['check_length']})
    {$ibforums->lang['profile_title']}
    {$ibforums->lang['website']}
    {$ibforums->lang['icq']}
    {$ibforums->lang['aol']}
    {$ibforums->lang['yahoo']}
    {$ibforums->lang['msn']}
    {$ibforums->lang['location']}
    ({$ibforums->lang['check_length']})
    {$ibforums->lang['interests']}
    ({$ibforums->lang['check_length']})
    + +
    $title
    $desc
    $content
    + + + + + + +
    +   +
    + + + + + + + + + +
      
    + + + + +
    + + + {$ibforums->lang['m_messenger']}
    +
    + • {$ibforums->lang['mess_inbox']}
    + • {$ibforums->lang['mess_new']}
    + • {$ibforums->lang['mess_contact']}
    + • {$ibforums->lang['mess_folders']}
    + • {$ibforums->lang['mess_archive']}
    + • {$ibforums->lang['mess_saved']}
    + • {$ibforums->lang['mess_tracker']}
    +
    + + + + {$ibforums->lang['m_tracker']}
    +
    + • {$ibforums->lang['m_view_subs']}
    + • {$ibforums->lang['m_view_forum']}
    +
    + + + {$ibforums->lang['m_personal']}
    +
    + • {$ibforums->lang['m_contact_info']}
    + + • {$ibforums->lang['m_sig_info']}
    + • {$ibforums->lang['m_avatar_info']}
    + + + +
    + {$ibforums->lang['m_options']}
    +
    + • {$ibforums->lang['m_email_opt']}
    + • {$ibforums->lang['m_board_opt']}
    + • {$ibforums->lang['m_skin_lang']}
    + • {$ibforums->lang['m_email_change']}
    + • {$ibforums->lang['m_passy_opt']}
    + + +
    +
    + + + + +EOF; +} + +function CP_end() { +global $ibforums; +return << + +
    +
    +
    +EOF; +} + +function splash($member) { +global $ibforums; +return <<{$ibforums->lang['stats_header']}
    + + + + + + + + + + + + + + + + + +
    {$ibforums->lang['email_address']}{$member[MEMBER_EMAIL]}
    {$ibforums->lang['number_posts']}{$member[MEMBER_POSTS]}
    {$ibforums->lang['registered']}{$member[DATE_REGISTERED]}
    {$ibforums->lang['daily_average']}{$member[DAILY_AVERAGE]}
    +
    {$ibforums->lang['messenger_summary']}
    + + + + + + + + + +
    {$ibforums->lang['total_messages']}{$member['total_messages']} {$member['full_percent']}
    {$ibforums->lang['messages_left']}{$member['space_free']} {$member['full_messenger']}
    +
    {$ibforums->lang['note_pad']}
    +
    + + + + + + + +
    + +
    +
    + + + + + +
    {$ibforums->lang['ta_size']}  + + +
    +
    +
    {$ibforums->lang['settings_time']}
    {$ibforums->lang['settings_time_txt']}
    $time
    $time_select
    {$ibforums->lang['dst_box']}
    {$ibforums->lang['settings_title']}
    {$ibforums->lang['settings_lang_txt']}$lang_select
    {$ibforums->lang['settings_skin']}
    {$ibforums->lang['settings_skin_txt']}$skin   
    {$ibforums->lang['settings_display']}
    {$ibforums->lang['settings_viewsig']}{$data[SIG]}
    {$ibforums->lang['settings_viewimg']}{$data[IMG]}
    {$ibforums->lang['settings_viewava']}{$data[AVA]}
    {$ibforums->lang['settings_dopopup']}{$data[POP]}
    {$ibforums->lang['hide_session_txt']}{$data[SESS]}
    {$ibforums->lang['pp_number_posts']}
    {$ibforums->lang['pp_number_topics']}
    {$ibforums->lang['privacy_settings']}
    {$ibforums->lang['hide_email']}
    {$ibforums->lang['admin_send']}
    {$ibforums->lang['board_prefs']}
    {$ibforums->lang['send_full_msg']}
    {$ibforums->lang['pm_reminder']}
    {$ibforums->lang['auto_track']}
    + +
    + + + + + + + + +EOF; +} + +function forum_subs_row($data) { +global $ibforums; +return << + + + + + + +EOF; +} + +function forum_subs_none() { +global $ibforums; +return << + + +EOF; +} + +function forum_subs_end() { +global $ibforums; +return << + + +
     {$ibforums->lang['ft_forum']}{$ibforums->lang['ft_topics']}{$ibforums->lang['ft_posts']}{$ibforums->lang['ft_last_post']}
    {$data['folder_icon']} + {$data['name']} +
    {$data['description']} +

    [ {$ibforums->lang['ft_unsub']} ] +
    {$data['topics']}{$data['posts']}{$data['last_post']}
    {$ibforums->lang['in']} {$data['last_topic']}
    {$ibforums->lang['by']} {$data['last_poster']}
    {$ibforums->lang['forum_subs_none']}
    {$ibforums->lang['ft_unsub_all']}
    +
    {$ibforums->lang['subs_header']} +
    + + + +
    + + + + + + + + + +EOF; +} + +function subs_row($data) { +global $ibforums; +return << + + + + + + + +EOF; +} + + +function subs_none() { +global $ibforums; +return << + + +EOF; +} + +function subs_forum_row($fid, $fname) { +global $ibforums; +return << + + +EOF; +} + +function subs_end($text="", $days="") { +global $ibforums; +return << + + + +
     {$ibforums->lang['subs_topic']}{$ibforums->lang['subs_replies']}{$ibforums->lang['subs_view']}{$ibforums->lang['subs_last_post']}
    {$data['folder_icon']}vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data['forum_id']}&t={$data['tid']}'>{$data['title']} ( vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data['forum_id']}&t={$data['tid']}' target='_blank'>{$ibforums->lang['new_window']} )
    {$data['description']}{$ibforums->lang['subs_start']} {$data['start_date']}
    {$data['posts']}{$data['views']}{$data['last_post_date']}
    {$ibforums->lang['subs_by']} {$data['last_poster']}
    {$ibforums->lang['subs_none']}
    $fname
      {$ibforums->lang['with_selected']}
    +
    + + + + + + + +
    $text
    +
    + {$ibforums->lang['show_topics_from']} + +
    +
    +
    + + + + +
    +
    + +
    +
    {$data}
    +
    +EOF; +} + + +} ?> \ No newline at end of file diff --git a/upload/admin.php b/upload/admin.php index d1eb6952..1f741bda 100644 --- a/upload/admin.php +++ b/upload/admin.php @@ -1,614 +1,633 @@ - Admin wrapper script -| > Script written by Matt Mecham -| > Date started: 1st March 2002 -| -+-------------------------------------------------------------------------- -*/ - -/*----------------------------------------------- - USER CONFIGURABLE ELEMENTS - ------------------------------------------------*/ - -// Root path - -$root_path = "./"; - -// Check IP address to see if they match? -// this may cause problems for users on proxies -// where the IP address changes during a session - -$check_ip = 1; - -// Use GZIP content encoding for fast page generation -// in the admin center? - -$use_gzip = 1; - - -/*----------------------------------------------- - NO USER EDITABLE SECTIONS BELOW - ------------------------------------------------*/ - -error_reporting (E_ERROR | E_WARNING | E_PARSE); -set_magic_quotes_runtime(0); - -if (function_exists('ini_get')) -{ - $safe_switch = ini_get("safe_mode") ? 1 : 0; -} -else -{ - $safe_switch = 1; -} - -define( 'SAFE_MODE_ON', $safe_switch ); - -if (function_exists("set_time_limit") == 1 and SAFE_MODE_ON == 0) -{ - @set_time_limit(0); -} - - -class Debug { - function startTimer() { - global $starttime; - $mtime = microtime (); - $mtime = explode (' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $starttime = $mtime; - } - function endTimer() { - global $starttime; - $mtime = microtime (); - $mtime = explode (' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $endtime = $mtime; - $totaltime = round (($endtime - $starttime), 5); - return $totaltime; - } -} - -class info { - - var $vars = ""; - var $version = '1.0'; - - - function info($INFO) - { - //global $INFO; - $this->vars = $INFO; - } -} - - - -/*----------------------------------------------- - Import $INFO - ------------------------------------------------*/ - -require $root_path."conf_global.php"; - -$ibforums = new info($INFO); - -$Debug = new Debug; -$Debug->startTimer(); - -/*----------------------------------------------- - Make sure our data is reset on each invocation - ------------------------------------------------*/ -$MEMBER = array(); -$SESSION_ID = ""; -$SKIN = ""; - -// Put an end to insane thoughs before they begin -$MEMBER_NAME = ""; -$MEMBER_PASSWORD = ""; -$MEMBER_EMAIL = ""; -$UserName = ""; -$PassWord = ""; - - -/*----------------------------------------------- - Load up our classes (compiled into one package) - ------------------------------------------------*/ - -require $root_path."sources/functions.php"; - -$std = new FUNC; - -/*----------------------------------------------- - Steralize our FORM and GET input - ------------------------------------------------*/ - -$IN = $std->parse_incoming(); - -$IN['AD_SESS'] = $HTTP_POST_VARS['adsess'] ? $HTTP_POST_VARS['adsess'] : $HTTP_GET_VARS['adsess']; - -/*----------------------------------------------- - Import $PAGES and $CATS - ------------------------------------------------*/ - -require $root_path."sources/Admin/admin_pages.php"; - - -/*----------------------------------------------- - Import Skinable elements - ------------------------------------------------*/ - -require $root_path."sources/Admin/admin_skin.php"; - -$SKIN = new admin_skin(); - -/*----------------------------------------------- - Import Admin Functions - ------------------------------------------------*/ - -require $root_path."sources/Admin/admin_functions.php"; - -$ADMIN = new admin_functions(); - -/*----------------------------------------------- - Load up our database library - ------------------------------------------------*/ - -$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; - -$to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; -require ($to_require); - -$DB = new db_driver; - -$DB->obj['sql_database'] = $INFO['sql_database']; -$DB->obj['sql_user'] = $INFO['sql_user']; -$DB->obj['sql_pass'] = $INFO['sql_pass']; -$DB->obj['sql_host'] = $INFO['sql_host']; -$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; - -// Get a DB connection -$DB->connect(); - -//------------------------------------------------ -// Fix up the "show" ID's for the menu tree... -// -// show=1,4,5 holds the current ID's, clicking on a -// collapse link creates out=4 - "4" is then removed -// from the show link. -// -// Good eh? -//------------------------------------------------ - -if ($IN['show'] == 'none') -{ - $IN['show'] = ""; -} -else if ($IN['show'] == 'all') -{ - $IN['show'] = ""; - - foreach($CATS as $cid => $name) - { - $IN['show'] .= $cid.','; - } -} -else -{ - $IN['show'] = preg_replace( "/(?:^|,)".$IN['out']."(?:,|$)/", ",", $IN['show'] ); - $IN['show'] = preg_replace( "/,,/" , "" , $IN['show'] ); - $IN['show'] = preg_replace( "/,$/" , "" , $IN['show'] ); - $IN['show'] = preg_replace( "/^,/" , "" , $IN['show'] ); -} - - -//------------------------------------------------ -// Admin.php Rules: -// -// No adsess number? -// ----------------- -// -// Then we log into the admin CP -// -// Got adsess number? -// ------------------ -// -// Then we check the cookie "ad_login" for a session key. -// -// If this session key matches the one stored in the admin_sessions -// table, then we check the data against the data stored in the -// profiles table. -// -// The session key and ad_sess keys are generated each time we log in. -// -// If we don't have a valid adsess in the URL, then we ask for a log in. -// -//------------------------------------------------ - -$session_validated = 0; -$this_session = array(); - -$validate_login = 0; - -if ($IN['login'] != 'yes') { - - if ( (!$IN['adsess']) or (empty($IN['adsess'])) or (!isset($IN['adsess'])) or ($IN['adsess'] == "") ) - { - //---------------------------------- - // No URL adsess found, lets log in. - //---------------------------------- - - do_login("No administration session found"); - } - else - { - //---------------------------------- - // We have a URL adsess, lets verify... - //---------------------------------- - - $DB->query("SELECT * FROM ibf_admin_sessions WHERE ID='".$IN['adsess']."'"); - $row = $DB->fetch_row(); - - if ($row['ID'] == "") - { - //---------------------------------- - // Fail-safe, no DB record found, lets log in.. - //---------------------------------- - - do_login("Could not retrieve session record"); - } - else if ($row['MEMBER_ID'] == "") - { - - //---------------------------------- - // No member ID is stored, log in! - //---------------------------------- - - do_login("Could not retrieve a valid member id"); - - } - else - { - //---------------------------------- - // Key is good, check the member details - //---------------------------------- - - $DB->query("SELECT * FROM ibf_members WHERE id='".$row['MEMBER_ID']."'"); - $MEMBER = $DB->fetch_row(); - - if ($MEMBER['id'] == "") - { - - //---------------------------------- - // Ut-oh, no such member, log in! - //---------------------------------- - - do_login("Member ID invalid"); - - } - else - { - //---------------------------------- - // Member found, check passy - //---------------------------------- - - if ($row['SESSION_KEY'] != $MEMBER['password']) - { - //---------------------------------- - // Passys don't match.. - //---------------------------------- - - do_login("Session member password mismatch"); - - } - else - { - //---------------------------------- - // Do we have admin access? - //---------------------------------- - - $DB->query("SELECT * FROM ibf_groups WHERE g_id='".$MEMBER['mgroup']."'"); - - $GROUP = $DB->fetch_row(); - - if ($GROUP['g_access_cp'] != 1) - { - do_login("You do not have access to the administrative CP"); - } - else - { - $session_validated = 1; - $this_session = $row; - } - } - } - } - } -} -else -{ - //---------------------------------- - // We must have submitted the form - // time to check some details. - //---------------------------------- - - if ( empty($IN['username']) ) - { - do_login("You must enter a username before proceeding"); - } - - if ( empty($IN['password']) ) - { - do_login("You must enter a password before proceeding"); - } - - //---------------------------------- - // Attempt to get the details from the - // DB - //---------------------------------- - - $DB->query("SELECT name, password, id, mgroup FROM ibf_members WHERE LOWER(name)='".strtolower($IN['username'])."'"); - $mem = $DB->fetch_row(); - - if ( empty($mem['id']) ) - { - do_login("Could not find a record matching that username, please check the spelling"); - } - - $pass = md5( $IN['password'] ); - - if ($pass != $mem['password']) - { - do_login("The password entered did not match the one in our records"); - } - else - { - $DB->query("SELECT * FROM ibf_groups WHERE g_id='".$mem['mgroup']."'"); - - $GROUP = $DB->fetch_row(); - - if ($GROUP['g_access_cp'] != 1) - { - do_login("You do not have access to the administrative CP"); - } - else - { - - //---------------------------------- - // All is good, rejoice as we set a - // session for this user - //---------------------------------- - - $sess_id = md5( uniqid( microtime() ) ); - - $db_string = $DB->compile_db_insert_string( array ( - 'ID' => $sess_id, - 'IP_ADDRESS' => $IN['IP_ADDRESS'], - 'MEMBER_NAME' => $mem['name'], - 'MEMBER_ID' => $mem['id'], - 'SESSION_KEY' => $pass, - 'LOCATION' => 'index', - 'LOG_IN_TIME' => time(), - 'RUNNING_TIME' => time(), - ) ); - - $DB->query("INSERT INTO ibf_admin_sessions (".$db_string['FIELD_NAMES'].") VALUES (".$db_string['FIELD_VALUES'].")"); - - $IN['AD_SESS'] = $sess_id; - - // Print the "well done page" - - $ADMIN->page_title = "Log in successful"; - - $ADMIN->page_detail = "You may now proceed to the administrative control panel"; - - $ADMIN->html .= $SKIN->start_table("Proceed"); - - $ADMIN->html .= "
    Take me to administrative control panel
    ( Click here if you do not wish to wait )
    CSS ID Definition name?
    Font name (seperate many with a comma)
    Font size  
    Font Weight
    Font Colour
    Background Colour
    Border... Weight (in pixels or leave blank) Colour
    Line Spacing  
    Letter Spacing  point



    Your CSS will appear below once generated.
    \ No newline at end of file + CSS Generator
    Simple CSS Generator

    This is designed to generate a simple CSS definition. It does not contain all the CSS attributes, just the most commonly used ones.

    CSS ID Definition name?
    Font name (separate many with a comma)
    Font size  
    Font Weight
    Font Colour
    Background Colour
    Border... Weight (in pixels or leave blank)  Colour
    Line Spacing  
    Letter Spacing  point



    Your CSS will appear below once generated.
    \ No newline at end of file diff --git a/upload/html/sys-img/ipshosting.gif b/upload/html/sys-img/ipshosting.gif new file mode 100644 index 00000000..51023997 Binary files /dev/null and b/upload/html/sys-img/ipshosting.gif differ diff --git a/upload/html/sys-img/nav.gif b/upload/html/sys-img/nav.gif new file mode 100644 index 00000000..bf54d231 Binary files /dev/null and b/upload/html/sys-img/nav.gif differ diff --git a/upload/index.php b/upload/index.php index e902741c..0a670478 100644 --- a/upload/index.php +++ b/upload/index.php @@ -1,285 +1,301 @@ - Wrapper script -| > Script written by Matt Mecham -| > Date started: 14th February 2002 -| -+-------------------------------------------------------------------------- -*/ - -//----------------------------------------------- -// USER CONFIGURABLE ELEMENTS -//----------------------------------------------- - -// Root path - -$root_path = "./"; - -//----------------------------------------------- -// NO USER EDITABLE SECTIONS BELOW -//----------------------------------------------- - -error_reporting (E_ERROR | E_WARNING | E_PARSE); -set_magic_quotes_runtime(0); - -class Debug { - function startTimer() { - global $starttime; - $mtime = microtime (); - $mtime = explode (' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $starttime = $mtime; - } - function endTimer() { - global $starttime; - $mtime = microtime (); - $mtime = explode (' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $endtime = $mtime; - $totaltime = round (($endtime - $starttime), 5); - return $totaltime; - } -} - -class info { - - var $member = array(); - var $input = array(); - var $session_id = ""; - var $base_url = ""; - var $vars = ""; - var $skin_id = "0"; // Skin Dir name - var $skin_rid = ""; // Real skin id (numerical only) - var $lang_id = "en"; - var $skin = ""; - var $lang = ""; - var $server_load = 0; - var $version = "v1.0.1"; - var $lastclick = ""; - var $location = ""; - - function info() { - global $sess, $std, $DB, $root_path, $INFO; - - $this->vars = &$INFO; - - $this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons'; - $this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars'; - $this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons'; - $this->vars['mime_img'] = $INFO['html_url'] . '/mime_types'; - - } -} - -//-------------------------------- -// Import $INFO, now! -//-------------------------------- - -require $root_path."conf_global.php"; - -//-------------------------------- -// The clocks a' tickin' -//-------------------------------- - -$Debug = new Debug; -$Debug->startTimer(); - -//-------------------------------- -// Require our global functions -//-------------------------------- - -require $root_path."sources/functions.php"; - -$std = new FUNC; -$print = new display(); -$sess = new session(); - -//-------------------------------- -// Load the DB driver and such -//-------------------------------- - -$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; - -$to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; -require ($to_require); - -$DB = new db_driver; - -$DB->obj['sql_database'] = $INFO['sql_database']; -$DB->obj['sql_user'] = $INFO['sql_user']; -$DB->obj['sql_pass'] = $INFO['sql_pass']; -$DB->obj['sql_host'] = $INFO['sql_host']; -$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; - -// Get a DB connection - -$DB->connect(); - -//-------------------------------- -// Wrap it all up in a nice easy to -// transport super class -//-------------------------------- - -$ibforums = new info(); - -//-------------------------------- -// Set up our vars -//-------------------------------- - -$ibforums->input = $std->parse_incoming(); -$ibforums->member = $sess->authorise(); -$ibforums->skin = $std->load_skin(); -$ibforums->lastclick = $sess->last_click; -$ibforums->location = $sess->location; -$ibforums->session_id = $sess->session_id; - -if ($ibforums->member['id'] and ( $std->my_getcookie('hide_sess') ) ) -{ - $ibforums->session_id = ""; -} - -$ibforums->base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?s='.$ibforums->session_id; - -$ibforums->skin_rid = $ibforums->skin['set_id']; -$ibforums->skin_id = 's'.$ibforums->skin['set_id']; - -$ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['img_id']; - -//-------------------------------- -// Set up our language choice -//-------------------------------- - -$ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : 'en'; - -if ( ($ibforums->lang_id != 'en') and (! is_dir( $root_path."lang/".$ibforums->lang_id ) ) ) -{ - $ibforums->lang_id = 'en'; -} - -require $root_path."lang/".$ibforums->lang_id."/lang_global.php"; - -$ibforums->lang = $lang; - -unset($lang); - -//-------------------------------- - -require $root_path."Skin/".$ibforums->skin_id."/skin_global.php"; - -$skin_universal = new skin_global(); - -//-------------------------------- - -if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and $ibforums->input['act'] != 'Attach') -{ - - //-------------------------------- - // Do we have permission to view - // the board? - //-------------------------------- - - if ($ibforums->member['g_view_board'] != 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_board') ); - } - - //-------------------------------- - // Is the board offline? - //-------------------------------- - - if ($ibforums->vars['board_offline'] == 1) - { - if ($ibforums->member['g_access_offline'] != 1) - { - $std->board_offline(); - } - - } - - //-------------------------------- - // Is log in enforced? - //-------------------------------- - - if ( (! $ibforums->member['id']) and ($ibforums->vars['force_login'] == 1) ) - { - require $root_path."sources/Login.php"; - - } - -} - -//-------------------------------- -// Decide what to do -//-------------------------------- - -$choice = array( - "idx" => "Boards", - "SF" => "Forums", - "SR" => "Forums", - "ST" => "Topics", - "Login" => "Login", - "Post" => "Post", - "Poll" => "lib/add_poll", - "Reg" => "Register", - "Online" => "Online", - "Members" => "Memberlist", - "Help" => "Help", - "Search" => "Search", - "Mod" => "Moderate", - "Print" => "misc/print_page", - "Forward" => "misc/forward_page", - "Mail" => "misc/contact_member", - "Invite" => "misc/contact_member", - "ICQ" => "misc/contact_member", - "AOL" => "misc/contact_member", - "Msg" => "Messenger", - "UserCP" => "Usercp", - "Profile" => "Profile", - "Track" => "misc/tracker", - "Stats" => "misc/stats", - "Attach" => "misc/attach", - 'ib3' => 'misc/ib3', - 'legends' => 'misc/legends', - 'ModCP' => 'mod_cp', - ); - - -/***************************************************/ - -$ibforums->input['act'] = $ibforums->input['act'] == '' ? "idx" : $ibforums->input['act']; - -// Check to make sure the array key exits.. - -if (! isset($choice[ $ibforums->input['act'] ]) ) -{ - $ibforums->input['act'] = 'idx'; -} - -// Require and run - -require $root_path."sources/".$choice[ $ibforums->input['act'] ].".php"; - - - -//+------------------------------------------------- -// GLOBAL ROUTINES -//+------------------------------------------------- - -function fatal_error($message="", $help="") { - echo("$message

    $help"); - exit; -} -?> + Wrapper script +| > Script written by Matt Mecham +| > Date started: 14th February 2002 +| ++-------------------------------------------------------------------------- +*/ + +//----------------------------------------------- +// USER CONFIGURABLE ELEMENTS +//----------------------------------------------- + +// Root path + +$root_path = "./"; + +//----------------------------------------------- +// NO USER EDITABLE SECTIONS BELOW +//----------------------------------------------- + +error_reporting (E_ERROR | E_WARNING | E_PARSE); +set_magic_quotes_runtime(0); + +class Debug { + function startTimer() { + global $starttime; + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $starttime = $mtime; + } + function endTimer() { + global $starttime; + $mtime = microtime (); + $mtime = explode (' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $endtime = $mtime; + $totaltime = round (($endtime - $starttime), 5); + return $totaltime; + } +} + +class info { + + var $member = array(); + var $input = array(); + var $session_id = ""; + var $base_url = ""; + var $vars = ""; + var $skin_id = "0"; // Skin Dir name + var $skin_rid = ""; // Real skin id (numerical only) + var $lang_id = "en"; + var $skin = ""; + var $lang = ""; + var $server_load = 0; + var $version = "v1.1 BETA 1"; + var $lastclick = ""; + var $location = ""; + var $debug_html = ""; + + function info() { + global $sess, $std, $DB, $root_path, $INFO; + + $this->vars = &$INFO; + + $this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons'; + $this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars'; + $this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons'; + $this->vars['mime_img'] = $INFO['html_url'] . '/mime_types'; + + } +} + +//-------------------------------- +// Import $INFO, now! +//-------------------------------- + +require $root_path."conf_global.php"; + +//-------------------------------- +// The clocks a' tickin' +//-------------------------------- + +$Debug = new Debug; +$Debug->startTimer(); + +//-------------------------------- +// Require our global functions +//-------------------------------- + +require $root_path."sources/functions.php"; + +$std = new FUNC; +$print = new display(); +$sess = new session(); + +//-------------------------------- +// Load the DB driver and such +//-------------------------------- + +$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; + +$to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; +require ($to_require); + +$DB = new db_driver; + +$DB->obj['sql_database'] = $INFO['sql_database']; +$DB->obj['sql_user'] = $INFO['sql_user']; +$DB->obj['sql_pass'] = $INFO['sql_pass']; +$DB->obj['sql_host'] = $INFO['sql_host']; +$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; + +$DB->obj['debug'] = ($INFO['sql_debug'] == 1) ? $_GET['debug'] : 0; + +// Get a DB connection + +$DB->connect(); + +//-------------------------------- +// Wrap it all up in a nice easy to +// transport super class +//-------------------------------- + +$ibforums = new info(); + +//-------------------------------- +// Set up our vars +//-------------------------------- + +$ibforums->input = $std->parse_incoming(); +$ibforums->member = $sess->authorise(); +$ibforums->skin = $std->load_skin(); +$ibforums->lastclick = $sess->last_click; +$ibforums->location = $sess->location; +$ibforums->session_id = $sess->session_id; + +list($ppu,$tpu) = explode( "&", $ibforums->member['view_prefs'] ); + +$ibforums->vars['display_max_topics'] = ($tpu > 0) ? $tpu : $ibforums->vars['display_max_topics']; +$ibforums->vars['display_max_posts'] = ($ppu > 0) ? $ppu : $ibforums->vars['display_max_posts']; + +if ($ibforums->member['id'] and ( $std->my_getcookie('hide_sess') ) ) +{ + $ibforums->session_id = ""; +} + +$ibforums->base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?s='.$ibforums->session_id; + +$ibforums->skin_rid = $ibforums->skin['set_id']; +$ibforums->skin_id = 's'.$ibforums->skin['set_id']; + +$ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['img_dir']; + +//-------------------------------- +// Set up our language choice +//-------------------------------- + +if ($ibforums->vars['default_language'] == "") +{ + $ibforums->vars['default_language'] = 'en'; +} + +$ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : $ibforums->vars['default_language']; + +if ( ($ibforums->lang_id != $ibforums->vars['default_language']) and (! is_dir( $root_path."lang/".$ibforums->lang_id ) ) ) +{ + $ibforums->lang_id = $ibforums->vars['default_language']; +} + +require $root_path."lang/".$ibforums->lang_id."/lang_global.php"; + +$ibforums->lang = $lang; + +unset($lang); + +//-------------------------------- + +$skin_universal = $std->load_template('skin_global'); + +//-------------------------------- + +if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and $ibforums->input['act'] != 'Attach') +{ + + //-------------------------------- + // Do we have permission to view + // the board? + //-------------------------------- + + if ($ibforums->member['g_view_board'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_board') ); + } + + //-------------------------------- + // Is the board offline? + //-------------------------------- + + if ($ibforums->vars['board_offline'] == 1) + { + if ($ibforums->member['g_access_offline'] != 1) + { + $std->board_offline(); + } + + } + + //-------------------------------- + // Is log in enforced? + //-------------------------------- + + if ( (! $ibforums->member['id']) and ($ibforums->vars['force_login'] == 1) ) + { + require $root_path."sources/Login.php"; + + } + +} + +//-------------------------------- +// Decide what to do +//-------------------------------- + +$choice = array( + "idx" => "Boards", + "SF" => "Forums", + "SR" => "Forums", + "ST" => "Topics", + "Login" => "Login", + "Post" => "Post", + "Poll" => "lib/add_poll", + "Reg" => "Register", + "Online" => "Online", + "Members" => "Memberlist", + "Help" => "Help", + "Search" => "Search", + "Mod" => "Moderate", + "Print" => "misc/print_page", + "Forward" => "misc/forward_page", + "Mail" => "misc/contact_member", + "Invite" => "misc/contact_member", + "ICQ" => "misc/contact_member", + "AOL" => "misc/contact_member", + "YAHOO" => "misc/contact_member", + "MSN" => "misc/contact_member", + "report" => "misc/contact_member", + "Msg" => "Messenger", + "UserCP" => "Usercp", + "Profile" => "Profile", + "Track" => "misc/tracker", + "Stats" => "misc/stats", + "Attach" => "misc/attach", + 'ib3' => 'misc/ib3', + 'legends' => 'misc/legends', + 'modcp' => 'mod_cp', + 'calendar' => "calendar", + 'buddy' => "browsebuddy", + ); + + +/***************************************************/ + +$ibforums->input['act'] = $ibforums->input['act'] == '' ? "idx" : $ibforums->input['act']; + +// Check to make sure the array key exits.. + +if (! isset($choice[ $ibforums->input['act'] ]) ) +{ + $ibforums->input['act'] = 'idx'; +} + +// Require and run + +require $root_path."sources/".$choice[ $ibforums->input['act'] ].".php"; + + + +//+------------------------------------------------- +// GLOBAL ROUTINES +//+------------------------------------------------- + +function fatal_error($message="", $help="") { + echo("$message

    $help"); + exit; +} +?> diff --git a/upload/install_templates.txt b/upload/install_templates.txt new file mode 100644 index 00000000..b2f40783 --- /dev/null +++ b/upload/install_templates.txt @@ -0,0 +1 @@ +(1, 'skin_boards', '\n\n \n
    \n \n \n \n \n
    base_url}&act=Stats&CODE=leaders\'>{$ibforums->lang[\'sm_forum_leaders\']} |\n base_url}&act=Search&CODE=getactive\'>{$ibforums->lang[\'sm_todays_posts\']} |\n base_url}&act=Stats\'>{$ibforums->lang[\'sm_today_posters\']} |\n base_url}&act=Members&max_results=10&sort_key=posts&sort_order=desc\'>{$ibforums->lang[\'sm_all_posters\']}
    \n
    \n \' align=\'center\' class=\'solidborder\'>\n \n \n \n
    \n \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n', 'stats_header', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n \n \n \n \n \n \n', 'ActiveUsers', '$active', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n \n \n \n \n \n \n', 'ShowStats', '$text', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n \n \n \n \n \n \n', 'birthdays', '$birthusers="", $total="", $birth_lang=""', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n \n \n \n \n \n \n', 'calendar_events', '$events = ""', 1035406235, 0);||~&~||(1, 'skin_boards', '\n
    {$ibforums->lang[\'board_stats\']}
    $active[TOTAL] {$ibforums->lang[\'active_users\']}
    <{F_ACTIVE}>{$active[GUESTS]} {$ibforums->lang[\'guests\']}, $active[MEMBERS] {$ibforums->lang[\'public_members\']} $active[ANON] {$ibforums->lang[\'anon_members\']} {$active[LINK]}
    {$active[NAMES]}
    {$ibforums->lang[\'board_stats\']}
    <{F_STATS}>$text
    {$ibforums->lang[\'most_online\']}
    {$ibforums->lang[\'birthday_header\']}
    <{F_ACTIVE}>$total $birth_lang
    $birthusers
    {$ibforums->lang[\'calender_f_title\']}
    <{F_ACTIVE}>$events
    \n
    \n \n
    \n \n', 'stats_footer', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n
    \n \n \n \n \n
    [ {$ibforums->lang[\'d_delete_cookies\']} ] :: [ {$ibforums->lang[\'d_post_read\']} ]
    \n', 'BoardInformation', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n\n \n \n \n \n \n \n \n \n \n \n \n \n', 'ForumRow', '$info', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n\n \n', 'buddy_js', '', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n\n {$ibforums->lang[\'new_posts\']}\n
    \n {$ibforums->lang[\'my_replies\']}\n \n', 'build_away_msg', '', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n ( {$ibforums->lang[\'view_link\']} )\n', 'append_view', '$url=""', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n
    \n \n \n \n \n \n
    <{CAT_IMG}>{$Data[\'name\']}
    \n
    \n \n \n \n \n \n \n \n \n', 'CatHeader_Expanded', '$Data', 1035406235, 0);||~&~||(1, 'skin_boards', '\n
    \n
    {$ibforums->lang[\'cat_name\']}{$ibforums->lang[\'topics\']}{$ibforums->lang[\'replies\']}{$ibforums->lang[\'last_post_info\']}
    \n \n \n \n
    \n \n \n \n \n \n \n \n \n', 'subheader', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n \n \n
    {$ibforums->lang[\'cat_name\']}{$ibforums->lang[\'topics\']}{$ibforums->lang[\'replies\']}{$ibforums->lang[\'last_post_info\']}
     
    \n
    \n
    \n', 'end_this_cat', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n', 'end_all_cats', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n{$ibforums->vars[\'board_name\']} {$ibforums->lang[\'newslink\']} base_url}&act=ST&f=$fid&t=$tid\'>$title
    \n', 'newslink', '$fid="", $title="", $tid=""', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \' align=\'center\'>\n \n \n \n \n
    {$ibforums->lang[\'welcome_back_text\']} $lastvisit 
    \n', 'PageTop', '$lastvisit', 1035406235, 0);||~&~||(1, 'skin_boards', '\n
    \n \' align=\'center\'>\n \n \n \n \n
    {$ibforums->lang[\'qli_title\']}\n lang[\'qli_name\']}\'>\n \n lang[\'qli_go\']}\'>\n
    \n
    \n', 'quick_log_in', '', 1035406235, 0);||~&~||(1, 'skin_boards', '\n \n
    {$info[\'img_new_post\']}{$info[\'name\']}
    {$info[\'description\']}
    {$info[\'moderator\']}
    {$info[\'topics\']}{$info[\'posts\']}{$info[\'last_post\']}
    {$ibforums->lang[\'in\']}: {$info[\'last_topic\']}
    {$ibforums->lang[\'by\']}: {$info[\'last_poster\']}
    \n \n \n \n \n \n \n
    \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'page_title\']}   [ -  + ]
    {$ibforums->lang[\'while_away\']}
    $away_text
    {$ibforums->lang[\'show_me\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m_dark.gif\' border=\'0\'>{$ibforums->lang[\'sm_forum_leaders\']}
    vars[\'img_url\']}/nav_m_dark.gif\' border=\'0\'>{$ibforums->lang[\'sm_todays_posts\']}
    vars[\'img_url\']}/nav_m_dark.gif\' border=\'0\'>{$ibforums->lang[\'sm_today_posters\']}
    vars[\'img_url\']}/nav_m_dark.gif\' border=\'0\'>{$ibforums->lang[\'sm_all_posters\']}
    vars[\'img_url\']}/nav_m_dark.gif\' border=\'0\'>{$ibforums->lang[\'sm_my_last_posts\']}
    \n
    {$ibforums->lang[\'search_forums\']}
     lang[\'go\']}\'>
    {$ibforums->lang[\'search_help\']}
     lang[\'go\']}\'>
    \n
    \n
    \n \n
    \n', 'main', '$away_text=""', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n\n
    \n \n \n \n \n \n \n \n
    \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'page_title\']}
    {$ibforums->lang[\'log_in_needed\']}
    \n {$ibforums->lang[\'no_guests\']}\n

    \n
    \n {$ibforums->lang[\'log_in\']}\n

    \n {$ibforums->lang[\'lin_name\']}
    \n
    \n {$ibforums->lang[\'lin_pass\']}
    \n
    \n lang[\'log_in\']}\' class=\'forminput\'>\n
    \n

    \n {$ibforums->lang[\'reg_text\']}\n

    \n
    {$ibforums->lang[\'reg_link\']}
    \n
    \n
    \n
    \n \n
    \n
    \n\n', 'login', '', 1035406235, 0);||~&~||(1, 'skin_buddy', '\n\n \n \n \n \n
    [ {$ibforums->lang[\'refresh\']} ] | [ {$ibforums->lang[\'close_win\']} ]
    \n \n\n', 'closelink', '', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n
    \n', 'cal_edit_button', '$id', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n\n \n \n \n \n \n \n \n
      {$ibforums->lang[\'event_date\']} {$event[\'mday\']} {$event[\'month_text\']} {$event[\'year\']}  [ {$event[\'title\']} ] ($event_type)
    \n \n \n \n \n \n \n \n \n
    base_url}&act=Profile&MID={$member[\'id\']}\'>{$member[\'name\']}

    {$member[\'avatar\']}
    {$ibforums->lang[\'group\']} {$member[\'g_title\']}
    {$ibforums->lang[\'posts\']} {$member[\'posts\']}
    {$ibforums->lang[\'joined\']} {$member[\'joined\']}
    \n $edit_button\n \n {$event[\'event_text\']}\n \n \n
    \n \n \n \n \n
    \n << base_url}&act=calendar&d={$event[\'mday\']}&m={$event[\'month\']}&y={$event[\'year\']}\'>{$ibforums->lang[\'back\']}\n
    \n
    \n
    \n
    \n\n', 'cal_show_event', '$event, $member, $event_type, $edit_button=""', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n\n
    \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'cal_title_events\']}
    \n\n', 'cal_page_events_start', '', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n \n \n \n \n \n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'cal_birthdays\']}
    \n
    \n \n \n
    \n
      \n \n \n', 'cal_birthday_start', '', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n
    • base_url}&act=Profile&MID=$uid\'>$uname ($age)
    • \n', 'cal_birthday_entry', '$uid, $uname, $age=""', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n
    \n \n \n \n
    \n \n \n \n \n
    \n << base_url}&act=calendar&d={$ibforums->input[\'d\']}&m={$ibforums->input[\'m\']}&y={$ibforums->input[\'y\']}\'>{$ibforums->lang[\'back\']}\n
    \n
    \n
    \n', 'cal_birthday_end', '', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n\n
    \n
    base_url}&act=calendar\' method=\'POST\'>\n \' align=\'center\'>\n \n \n \n
    $month $year
    \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'table_title\']}\n < base_url}&act=calendar&m={$prev[\'month_id\']}&y={$prev[\'year_id\']}\'>{$prev[\'month_name\']} {$prev[\'year_id\']}\n    base_url}&act=calendar&m={$next[\'month_id\']}&y={$next[\'year_id\']}\'>{$next[\'month_name\']} {$next[\'year_id\']} >\n
    \n
    \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n
    \n    lang[\'form_submit_show\']}\' class=\'forminput\'>\n base_url}&act=calendar&code=newevent\'>{$ibforums->lang[\'post_new_event\']}\n < base_url}&act=calendar&m={$prev[\'month_id\']}&y={$prev[\'year_id\']}\'>{$prev[\'month_name\']} {$prev[\'year_id\']}\n    base_url}&act=calendar&m={$next[\'month_id\']}&y={$next[\'year_id\']}\'>{$next[\'month_name\']} {$next[\'year_id\']} >\n
    \n
    \n
    \n
    \n \n \n \n', 'cal_main_content', '$month, $year, $prev, $next', 1035406235, 0);||~&~||(1, 'skin_calendar', '\n\n
    $day

    $month_day $events$month_day$events
    \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'report_title\']}
    {$ibforums->lang[\'report_topic\']}base_url}&act=ST&f=$fid&t=$tid&st=$st&#entry$pid\'>$topic_title\n
    {$ibforums->lang[\'report_message\']}\n
    \n \n
    \n
    \n \n', 'report_form', '$fid, $tid, $pid, $st, $topic_title', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \n \n \n
    {$ibforums->lang[\'msn_name\']}
    {$ibforums->lang[\'msn_send_msg\']}
    {$ibforums->lang[\'msn_add_contact\']}
    {$ibforums->lang[\'yahoo_name\']}
    {$ibforums->lang[\'yahoo_status\']}
    {$ibforums->lang[\'yahoo_send_msg\']}
    {$ibforums->lang[\'yahoo_view_profile\']}
    {$ibforums->lang[\'name\']}member[\'name\']}\' size=\'40\' class=\'forminput\' onMouseOver="this.focus()" onFocus="this.select()">
    {$ibforums->lang[\'email\']}member[\'email\']}\' size=\'40\' class=\'forminput\' onMouseOver="this.focus()" onFocus="this.select()">
    {$ibforums->lang[\'msg\']}
    lang[\'submit\']}\' class=\'forminput\'>
    \n
     
    \n', 'end_table', '', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \' align=\'center\'>\n \n
    \n \n \n \n', 'pager_header', '$data', 1035406236, 0);||~&~||(1, 'skin_emails', '\n\n
    {$data[TITLE]}
    \n
    Download AIMAIM Remote
    Send me an Instant Message
    Add me to Your Buddy List
    Add Remote to Your Page
    Download AOL Instant Messenger

    \n\n', 'aol_body', '$data', 1035406236, 0);||~&~||(1, 'skin_emails', '\n
    \n \n \n session_id}\'>\n input[\'st\']}\'>\n input[\'f\']}\'>\n input[\'t\']}\'>\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'title\']}
    {$ibforums->lang[\'send_lang\']}$lang
    {$ibforums->lang[\'to_name\']}
    {$ibforums->lang[\'to_email\']}
    {$ibforums->lang[\'subject\']}
    {$ibforums->lang[\'message\']}\n
    \n \n
    \n
    \n
    \n', 'forward_form', '$title, $text, $lang', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'send_email_to\']} {$data[NAME]}
    {$ibforums->lang[\'show_address_text\']}
    >>{$ibforums->lang[\'send_email_to\']} {$data[NAME]}
    \n
    \n', 'show_address', '$data', 1035406236, 0);||~&~||(1, 'skin_emails', '\n
    \n \n \n session_id}\'>\n \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'send_title\']}
    {$ibforums->lang[\'send_email_to\']} {$data[NAME]}
    {$ibforums->lang[\'subject\']}\n
    {$ibforums->lang[\'message\']}

    {$ibforums->lang[\'msg_txt\']}
    \n
    \n \n
    \n
    \n
    \n', 'send_form', '$data', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'email_sent\']}
    {$ibforums->lang[\'email_sent_txt\']} $member_name
    \n
    \n', 'sent_screen', '$member_name', 1035406236, 0);||~&~||(1, 'skin_emails', '\n \' align=\'center\'>\n \n \n \n
    $data
    \n', 'forum_jump', '$data', 1035406236, 0);||~&~||(1, 'skin_forum', '\n
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id};act=SF&f=$Data\' method=\'post\'>\n \n \n \n session_id}\'>\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'need_password\']}
    {$ibforums->lang[\'need_password_txt\']}
    {$ibforums->lang[\'enter_pass\']}
    lang[\'f_pass_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n', 'Forum_log_in', '$Data', 1035406236, 0);||~&~||(1, 'skin_forum', '\n \n
    \n \' align=\'center\'>\n \n \n \n
    {$rules[\'title\']}

    {$rules[\'body\']}
    \n
    \n \n', 'show_rules_full', '$rules', 1035406236, 0);||~&~||(1, 'skin_forum', '\n \n
    \n \' align=\'center\'>\n \n \n \n
    >>vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=SR&f={$rules[\'fid\']}\'>{$rules[\'title\']}
    \n
    \n \n', 'show_rules_link', '$rules', 1035406236, 0);||~&~||(1, 'skin_forum', '\n | base_url}&act=Track&f=$fid&type=forum\'>{$ibforums->lang[\'ft_title\']}\n', 'show_sub_link', '$fid', 1035406236, 0);||~&~||(1, 'skin_forum', '\n
    \n
    \n \n \n \n \n \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'showing_text\']}{$ibforums->lang[\'sort_text\']} lang[\'sort_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n\' border=\'0\' cellspacing=\'0\' cellpadding=\'4\' align=\'center\'>\n \n \n \n \n
    {$Data[SHOW_PAGES]}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$Data[\'id\']}\'><{A_POST}>{$Data[POLL_BUTTON]}
    \n\' border=\'0\' cellspacing=\'0\' cellpadding=\'3\' align=\'center\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    <{B_NEW}>{$ibforums->lang[\'pm_open_new\']} <{B_POLL}>{$ibforums->lang[\'pm_poll\']}  \n \n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\' name=\'search\'>\n session_id}\'>\n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'search_forum\']} lang[\'enter_keywords\']}\' onFocus=\'this.value = "";\'> lang[\'search_go\']}\' class=\'forminput\'>
    \n
    \n {$Data[FORUM_JUMP]}\n
    <{B_NORM}>{$ibforums->lang[\'pm_open_no\']} <{B_POLL_NN}>{$ibforums->lang[\'pm_poll_no\']} 
    <{B_HOT}>{$ibforums->lang[\'pm_hot_new\']} <{B_LOCKED}>{$ibforums->lang[\'pm_locked\']} 
    <{B_HOT_NN}>{$ibforums->lang[\'pm_hot_no\']} <{B_MOVED}>{$ibforums->lang[\'pm_moved\']} 
    \n', 'TableEnd', '$Data', 1035406236, 0);||~&~||(1, 'skin_forum', '\n \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n
    {$rules[\'title\']}
    {$rules[\'body\']}
    >>base_url}&act=SF&f={$rules[\'fid\']}\'>{$ibforums->lang[\'back_to_forum\']}
    \n
    \n
    \n \n', 'show_rules', '$rules', 1035406236, 0);||~&~||(1, 'skin_forum', '\n \' align=\'center\'>\n \n \n \n
    $title$pages
    \n', 'page_title', '$title="", $pages=""', 1035406236, 0);||~&~||(1, 'skin_forum', '\n\n\n\n\n\n\n\' border=\'0\' cellspacing=\'0\' cellpadding=\'4\' align=\'center\'>\n \n \n \n \n
    {$info[\'SHOW_PAGES\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$info[\'id\']}\'><{A_POST}>{$info[POLL_BUTTON]}
    \n\' align=\'center\' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\'>\n \n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}\' method=\'POST\'>\n \n \n \n \n \n \n', 'show_no_matches', '', 1035406236, 0);||~&~||(1, 'skin_forum', '\n $posts\n', 'who_link', '$tid, $posts', 1035406237, 0);||~&~||(1, 'skin_forum', '\n \n \n \n \n \n \n \n \n \n \n \n', 'RenderRow', '$Data', 1035406237, 0);||~&~||(1, 'skin_forum', '\n \n \n \n \n \n \n', 'render_pinned_start', '', 1035406237, 0);||~&~||(1, 'skin_forum', '\n \n \n \n \n \n \n', 'render_pinned_end', '', 1035406237, 0);||~&~||(1, 'skin_forum', '\n \n \n \n \n \n \n \n \n \n \n \n', 'render_pinned_row', '$Data', 1035406237, 0);||~&~||(1, 'skin_global', '\n
    \n \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$info[\'name\']}[ base_url}&act=Login&CODE=04&f={$info[\'id\']}\'>{$ibforums->lang[\'mark_as_read\']} ]
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n', 'PageTop', '$info', 1035406236, 0);||~&~||(1, 'skin_forum', '\n \n
    \n \n \n \n session_id}\'>\n input[\'st\']}\'>\n \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'20\' height=\'1\'>vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'20\' height=\'1\'>{$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}
    \n \n \n \n \n \n \n
    {$ibforums->lang[\'active_users_title\']} ({$ibforums->lang[\'active_users_detail\']})
    {$ibforums->lang[\'active_users_members\']} {$active[\'names\']}
    \n \n\n', 'forum_active_users', '$active=array()', 1035406236, 0);||~&~||(1, 'skin_forum', '\n
    \n
    \n {$ibforums->lang[\'no_topics\']}\n

    \n
    {$Data[\'folder_img\']}{$Data[\'topic_icon\']}\n \n \n \n \n \n
    {$Data[\'go_new_post\']}{$Data[\'prefix\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&s={$ibforums->session_id}\' class=\'linkthru\' title=\'{$ibforums->lang[\'topic_started_on\']} {$Data[\'start_date\']}\'>{$Data[\'title\']} {$Data[PAGES]}
    \n {$Data[\'description\']}
    {$Data[\'starter\']}{$Data[\'posts\']}{$Data[\'views\']}{$Data[\'last_post\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&view=getlastpost\'>{$Data[\'last_text\']} {$Data[\'last_poster\']}
      {$ibforums->lang[\'pinned_start\']}
      {$ibforums->lang[\'regular_topics\']}
    {$Data[\'folder_img\']}{$Data[\'topic_icon\']}\n \n \n \n \n \n
    {$Data[\'go_new_post\']}{$Data[\'prefix\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&s={$ibforums->session_id}\' class=\'linkthru\' title=\'{$ibforums->lang[\'topic_started_on\']} {$Data[\'start_date\']}\'>{$Data[\'title\']} {$Data[PAGES]}
    \n {$Data[\'description\']}
    {$Data[\'starter\']}{$Data[\'posts\']}{$Data[\'views\']}{$Data[\'last_post\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&view=getlastpost\'>{$Data[\'last_text\']} {$Data[\'last_poster\']}
    \n\n \n \n\n
    {$ibforums->lang[\'logged_in_as\']} {$ibforums->member[\'name\']} ( base_url}&act=Login&CODE=03\'>{$ibforums->lang[\'log_out\']}$ad_link $mod_link )\n base_url}&act=UserCP&CODE=00\' title=\'{$ibforums->lang[\'cp_tool_tip\']}\'>{$ibforums->lang[\'your_cp\']} | base_url}&act=Msg&CODE=01\'>{$msg[TEXT]}\n | base_url}&act=Search&CODE=getnew\'>{$ibforums->lang[\'view_new_posts\']} | lang[\'bb_tool_tip\']}\'>{$ibforums->lang[\'l_qb\']}\n
    \n', 'Member_bar', '$msg, $ad_link, $mod_link', 1035406237, 0);||~&~||(1, 'skin_global', '\n\'IPS\n', 'ibf_banner', '', 1035406237, 0);||~&~||(1, 'skin_global', '\n \n\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n \n \n\n
    \n vars[\'img_url\']}/header_tile.gif\'>\n \n \n \n \n
    base_url}\' title=\'Board Home\'>vars[\'img_url\']}/logo.jpg\' alt=\'Powered by Invision Board\' border=\'0\'>vars[\'img_url\']}/header_tile.gif\'>
    \n
    \n \n \n \n \n
    <% MEMBER BAR %>\n
    \n
    \n
    \n', 'BoardHeader', '$time=""', 1035406237, 0);||~&~||(1, 'skin_global', '\n\' align=\'center\' border="0" cellspacing="0" cellpadding="2">\n \n \n \n \n \n
    <{F_NAV}>\n \' class=\'row2\'>\n \n \n \n
    base_url}&act=Help\'>{$ibforums->lang[\'tb_help\']}\n \'>| base_url}&act=Search&f={$ibforums->input[\'f\']}\'>{$ibforums->lang[\'tb_search\']}\n \'>| base_url}&act=Members\'>{$ibforums->lang[\'tb_mlist\']}\n \'>| base_url}&act=calendar\'>{$ibforums->lang[\'tb_calendar\']}\n
    \n \n
    \n
    \n', 'end_nav', '', 1035406237, 0);||~&~||(1, 'skin_global', '\n\n\n{$ibforums->lang[\'stand_by\']}\nvars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}$Url\'>\n$css\n\n\n\' height=\'85%\' align=\'center\'>\n\n \n\n
    \n \n \n \n \n
    \n \n \n \n \n
    \n {$ibforums->lang[\'thanks\']}, \n $Text

    \n {$ibforums->lang[\'transfer_you\']}

    \n (vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}$Url\'>{$ibforums->lang[\'dont_wait\']})
    \n
    \n
    \n\n\n', 'Redirect', '$Text, $Url, $css', 1035406237, 0);||~&~||(1, 'skin_global', '\n \n', 'PM_popup', '', 1035406237, 0);||~&~||(1, 'skin_global', '\n {$ibforums->lang[\'guest_stuff\']} ( base_url}&act=Login&CODE=00\'>{$ibforums->lang[\'log_in\']} | base_url}&act=Reg&CODE=00\'>{$ibforums->lang[\'register\']} )\n', 'Guest_bar', '', 1035406237, 0);||~&~||(1, 'skin_global', '\n | vars[\'board_url\']}/admin.{$ibforums->vars[\'php_ext\']}\' target=\'_blank\'>{$ibforums->lang[\'admin_cp\']}\n', 'admin_link', '', 1035406237, 0);||~&~||(1, 'skin_global', '\n | base_url}&act=modcp\'>{$ibforums->lang[\'mod_cp\']}\n', 'mod_link', '', 1035406237, 0);||~&~||(1, 'skin_global', '\nvars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\' method=\'post\'>\n \n \n session_id}\'>\n \n \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'er_log_in_title\']}
    {$ibforums->lang[\'erl_enter_name\']}
    {$ibforums->lang[\'erl_enter_pass\']}
    \n lang[\'erl_log_in_submit\']}\' class=\'forminput\'>\n
    \n
    \n \n', 'error_log_in', '$q_string', 1035406237, 0);||~&~||(1, 'skin_global', '\n\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n \n \n
    \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$ibforums->lang[\'offline_title\']}
    \n
    \n \n \n \n \n \n \n \n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\' method=\'post\'>\n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n

    $message

    {$ibforums->lang[\'offline_login\']}
    {$ibforums->lang[\'erl_enter_name\']}
    vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'180\' height=\'1\'>
    {$ibforums->lang[\'erl_enter_pass\']}
    lang[\'erl_log_in_submit\']}\' class=\'forminput\'>
    \n', 'board_offline', '$message = ""', 1035406237, 0);||~&~||(1, 'skin_global', '\n \n\' border=\'0\' cellspacing=\'1\' align=\'center\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n \n \n
    \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$ibforums->lang[\'error_title\']}
    \n
    \n \n \n \n \n \n \n \n
    \n {$ibforums->lang[\'exp_text\']}

    \n {$ibforums->lang[\'msg_head\']}\n

    \n $message\n

    \n \n

    \n Useful Links:\n

    \n • base_url}&act=Reg&CODE=10\'>{$ibforums->lang[\'er_lost_pass\']}
    \n • base_url}&act=Reg&CODE=00\'>{$ibforums->lang[\'er_register\']}
    \n • base_url}&act=Help&CODE=00\'>{$ibforums->lang[\'er_help_files\']}
    \n • {$ibforums->lang[\'er_contact_admin\']}

    \n
    < {$ibforums->lang[\'error_back\']}
    \n
    \n', 'Error', '$message, $ad_email_one="", $ad_email_two=""', 1035406237, 0);||~&~||(1, 'skin_global', '\n {$ibforums->lang[\'logged_in_as\']} {$ibforums->member[\'name\']} ( base_url}&act=UserCP&CODE=00\'>{$ibforums->lang[\'your_cp\']} | base_url}&act=Login&CODE=03\'>{$ibforums->lang[\'log_out\']} )\n', 'Member_no_usepm_bar', '', 1035406237, 0);||~&~||(1, 'skin_help', '\n \n
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=Help&s={$ibforums->session_id}&CODE=01&HID={$entry[\'id\']}\'>{$entry[\'title\']}
    {$entry[\'description\']}
    $text
    \n
    \n', 'end', '', 1035406237, 0);||~&~||(1, 'skin_help', '\n
    {$ibforums->lang[\'no_results\']}
    \' align=\'center\'>\n \n
    $two_text
    \n\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    $one_text
    \n
    \n \n \n session_id}\'>\n {$ibforums->lang[\'search_txt\']}   lang[\'submit\']}\' class=\'forminput\'>\n
    \n
    \n
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n', 'start', '$one_text, $two_text, $three_text', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\nbase_url}&act=legends&entry=$entry&name=$name&sep=$sep&CODE=finduser_two\'>\n
    $three_text
    \n\n \n\n\n \n\n\n \n\n
    {$ibforums->lang[\'fu_title\']}
    {$ibforums->lang[\'fu_enter_name\']}



    lang[\'fu_search_but\']}\'>
    {$ibforums->lang[\'fu_close_win\']}
    \n\n\n', 'find_user_one', '$entry="", $name="", $sep="comma"', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n
    base_url}&entry=$entry&name=$name&sep=$sep&CODE=finduser_two\'>\n\n\n \n\n\n \n\n\n \n\n
    {$ibforums->lang[\'fu_error\']}
    $msg
    {$ibforums->lang[\'fu_back\']} :: {$ibforums->lang[\'fu_close_win\']}
    \n
    \n\n', 'find_user_error', '$msg', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n\n\n
    \n\n\n \n\n\n \n\n\n \n\n
    {$ibforums->lang[\'fu_title\']}
    {$ibforums->lang[\'fu_add_desc\']}



    lang[\'fu_add_mem\']}\'>
    {$ibforums->lang[\'fu_back\']} :: {$ibforums->lang[\'fu_close_win\']}
    \n
    \n\n', 'find_user_final', '$names="",$entry="", $name="", $sep="line"', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n', 'emoticon_javascript', '', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n\n\n', 'page_header', '$title, $row1, $row2', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n \n \n \n \n\n\n', 'emoticons_row', '$code, $image', 1035406237, 0);||~&~||(1, 'skin_legends', '\n\n
    $title
    $row1$row2
    $codevars[\'EMOTICONS_URL\']}/$image\' border=\'0\' valign=\'absmiddle\' alt=\'$image\'>
    \n
    \n\n', 'page_footer', '', 1035406238, 0);||~&~||(1, 'skin_login', '\n
    \n
    \n \n \n session_id}\'>\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n
    \' valign=\'left\' colspan=\'2\' class=\'titlelarge\'>{$ibforums->lang[\'log_out\']}

    {$ibforums->lang[\'log_out_txt\']}
    \n \n
    \n
    \n
    \n', 'ShowLogOutForm', '', 1035406238, 0);||~&~||(1, 'skin_login', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'errors_found\']}
    \'>$data
    \n
    \n
    \n', 'errors', '$data', 1035406238, 0);||~&~||(1, 'skin_login', '\n \n
    \n \'>\n \n \n \n \n \n \n
    {$ibforums->lang[\'login_text\']}
    {$ibforums->lang[\'forgot_pass\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=Reg&CODE=10\'>{$ibforums->lang[\'pass_link\']}
    \n
    \n \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    $message
    {$ibforums->lang[\'enter_name\']}
    {$ibforums->lang[\'enter_pass\']}
    \n
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'options\']}
    {$ibforums->lang[\'cookies\']}{$ibforums->lang[\'cookie_yes\']}
    {$ibforums->lang[\'cookie_no\']}
    {$ibforums->lang[\'privacy\']}{$ibforums->lang[\'anon_name\']}
    \n \n
    \n
    \n
    \n', 'ShowForm', '$message, $referer=""', 1035406238, 0);||~&~||(1, 'skin_mlist', '\n\n\n\n \n \n \n
    {$links[SHOW_PAGES]}
    \n\n \n \n \n \n \n \n \n \n \n
    \n  \n
    \n \n \n \n \n \n \n \n \n \n \n \n', 'Page_header', '$links', 1035406238, 0);||~&~||(1, 'skin_mlist', '\n
    {$ibforums->lang[\'member_name\']}{$ibforums->lang[\'member_level\']}{$ibforums->lang[\'member_group\']}{$ibforums->lang[\'member_joined\']}{$ibforums->lang[\'member_posts\']}{$ibforums->lang[\'member_email\']}{$ibforums->lang[\'member_aol\']}{$ibforums->lang[\'member_icq\']}
    \n \n \n \n
    {$links[SHOW_PAGES]}
    \n', 'end', '$links', 1035406238, 0);||~&~||(1, 'skin_mlist', '\nNo results\n', 'no_results', '', 1035406238, 0);||~&~||(1, 'skin_mlist', '\n\n', 'start', '', 1035406238, 0);||~&~||(1, 'skin_mlist', '\n \n \n
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id};act=Members\' method=\'POST\'>\n \n session_id}\'>\n
    \n   input[\'name\']}\'>
    \n {$ibforums->lang[\'sorting_text\']} lang[\'sort_submit\']}\' class=\'forminput\'>
    \n
    \n', 'Page_end', '', 1035406238, 0);||~&~||(1, 'skin_mlist', '\n \n
    {$member[MEMBER_NAME]}{$member[MEMBER_PIPS_IMG]}{$member[MEMBER_GROUP]}{$member[MEMBER_JOINED]}{$member[MEMBER_POSTS]}{$member[MEMBER_EMAIL]}{$member[AOLNAME]}{$member[ICQNUMBER]}
    \n \n \n \n \n \n
    {$ibforums->lang[\'cp_mod_posts_title2\']} $forumname\n
    $pages\n
    \n \'>\n \n \n \n \n', 'modtopicview_start', '$tid,$forumname, $fid, $title', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n\n \n \n \n', 'modpost_topicend', '', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\nbase_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n\n \n \n \n \n', 'modtopics_end', '', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n \n \n \n\n', 'mod_topic_spacer', '', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n\n \n \n\n', 'results', '$text', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n\n \n \n\n', 'prune_confirm', '$tcount, $count, $link, $link_text', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n', 'prune_splash', '$forum, $forums, $select', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n input[\'f\']}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n', 'edit_user_form', '$profile', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n input[\'f\']}\'>\n \n \n \n \n \n \n \n \n \n \n \n\n', 'find_two', '$select', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n input[\'f\']}\'>\n \n \n \n \n \n \n \n \n \n \n \n\n', 'find_user', '', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n \n \n \n \n \n \n\n', 'splash', '$tcount, $pcount, $forum', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n\n\n \n \n \n\n\n', 'mod_exp', '$words', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n\n \n
    $title
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_mod_posts_title2\']} $forumname\n
    \n \'>\n \n \n \n \n \n \n \n', 'modpost_topicstart', '$forumname, $fid', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n \n \n \n \n', 'modpost_topicentry', '$title, $tid, $replies, $fid', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n
    {$ibforums->lang[\'cp_3_title\']}{$ibforums->lang[\'cp_3_replies\']}{$ibforums->lang[\'cp_3_approveall\']}{$ibforums->lang[\'cp_3_viewall\']}
    base_url}&act=ST&f=$fid&t=$tid\' target=\'_blank\'>$title$repliesbase_url}&act=ModCP&f=$fid&tid=$tid&CODE=modtopicapprove\'>{$ibforums->lang[\'cp_3_approveall\']}base_url}&act=ModCP&f=$fid&tid=$tid&CODE=modtopicview\'>{$ibforums->lang[\'cp_3_viewall\']}
    \n
    \n
    \n \n \n \n \n \n', 'modtopics_start', '$pages,$forumname, $fid', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n
    {$ibforums->lang[\'cp_mod_topics_title2\']} $forumname\n
    $pages\n
      {$ibforums->lang[\'cp_1_selected\']}  lang[\'cp_1_go\']}\' class=\'forminput\'>
    \n
    \n \'>\n \n \n \n \n', 'mod_topic_title', '$title, $topic_id', 1035406238, 0);||~&~||(1, 'skin_mod', '\n \n \n \n \n \n \n\n', 'mod_postentry', '$data', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n\n', 'mod_postentry_checkbox', '$pid', 1035406238, 0);||~&~||(1, 'skin_mod', '\n\n
       $title
    {$data[\'member\'][\'name\']}

    {$data[\'member\'][\'avatar\']}
    {$data[\'member\'][\'MEMBER_GROUP\']}
    {$data[\'member\'][\'MEMBER_POSTS\']}
    {$data[\'member\'][\'MEMBER_JOINED\']}
    \n {$ibforums->lang[\'posted_on\']} {$data[\'msg\'][\'post_date\']}

    \n \n {$data[\'msg\'][\'post\']}\n \n
      {$ibforums->lang[\'cp_3_postno\']} $pid
    \n
    \n  \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_results\']}\n
    $text
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_check_result\']}\n
    {$ibforums->lang[\'cp_check_text\']}\n
    {$ibforums->lang[\'cp_total_topics\']}$tcount
    {$ibforums->lang[\'cp_total_match\']}$count
    base_url}$link\'>$link_text
    \n
    {$ibforums->lang[\'cp_prune\']} {$forum[\'name\']}
    {$ibforums->lang[\'cp_prune_text\']}
    {$ibforums->lang[\'cp_action\']}
    {$ibforums->lang[\'cp_prune_days\']}input[\'dateline\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_prune_type\']}$select
    {$ibforums->lang[\'cp_prune_replies\']}input[\'posts\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_prune_member\']}input[\'member\']}\' class=\'forminput\'>
    lang[\'cp_prune_sub1\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_edit_user\']}: {$profile[\'name\']}
    {$ibforums->lang[\'cp_remove_av\']}
    {$ibforums->lang[\'cp_edit_website\']}
    {$ibforums->lang[\'cp_edit_location\']}
    {$ibforums->lang[\'cp_edit_interests\']}
    {$ibforums->lang[\'cp_edit_signature\']}
    lang[\'cp_find_2_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_edit_user\']}
    {$ibforums->lang[\'cp_find_2_user\']}$select
    lang[\'cp_find_2_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_edit_user\']}
    {$ibforums->lang[\'cp_find_user\']}
    lang[\'cp_find_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_welcome\']}
    {$ibforums->lang[\'cp_welcome_text\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_mod_in\']}$forum
    {$ibforums->lang[\'cp_topics_wait\']}$tcount
    {$ibforums->lang[\'cp_posts_wait\']}$pcount
    \n
    $words
    \n \n
    \n
    \n \n\n\n', 'end_form', '$action', 1035406239, 0);||~&~||(1, 'skin_mod', '\n\n\n
    {$ibforums->lang[move_from]} $forum_name {$ibforums->lang[to]}:
    {$ibforums->lang[\'leave_link\']}\n \n
    {$ibforums->lang[edit_f_title]}
    {$ibforums->lang[edit_f_desc]}
    {$ibforums->lang[\'pe_option\']} $id
    {$ibforums->lang[\'pe_pollonly\']} $id
    \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n\n\n', 'table_top', '$posting_title', 1035406240, 0);||~&~||(1, 'skin_mod', '\n
    \n
    $posting_title
    \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'th_title\']}
    {$ibforums->lang[\'th_topic\']}{$data[\'th_topic\']}
    {$ibforums->lang[\'th_desc\']}{$data[\'th_desc\']}
    {$ibforums->lang[\'th_start_date\']}{$data[\'th_start_date\']}
    {$ibforums->lang[\'th_start_name\']}{$data[\'th_start_name\']}
    {$ibforums->lang[\'th_last_date\']}{$data[\'th_last_date\']}
    {$ibforums->lang[\'th_last_name\']}{$data[\'th_last_name\']}
    {$ibforums->lang[\'th_avg_post\']}{$data[\'th_avg_post\']}
    \n
    \n', 'topic_history', '$data', 1035406241, 0);||~&~||(1, 'skin_mod', '\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n\n', 'mod_log_start', '', 1035406241, 0);||~&~||(1, 'skin_mod', '\n \n \n \n\n', 'mod_log_none', '', 1035406241, 0);||~&~||(1, 'skin_mod', '\n \n \n \n \n \n\n', 'mod_log_row', '$data', 1035406241, 0);||~&~||(1, 'skin_mod', '\n
    {$ibforums->lang[\'ml_title\']}
    {$ibforums->lang[\'ml_name\']}{$ibforums->lang[\'ml_desc\']}{$ibforums->lang[\'ml_date\']}
    {$data[\'ml_none\']}
    {$data[\'member\']}{$data[\'action\']}{$data[\'date\']}
    \n
    \n\n', 'mod_log_end', '', 1035406241, 0);||~&~||(1, 'skin_mod', '\n\n
    \n\' align=\'center\'>\n \n \n \n
    {$data}
    \n
    \n', 'forum_jump', '$data, $menu_extra=""', 1035406241, 0);||~&~||(1, 'skin_mod', '\n\n\n
    {$ibforums->lang[\'mt_new_title\']}
    {$ibforums->lang[\'mt_new_desc\']}
    {$ibforums->lang[\'st_forum\']}
    \n \'>\n \n \n \n\n\n', 'split_body', '$jump=""', 1035406241, 0);||~&~||(1, 'skin_mod', '\n\n \n \n \n\n\n', 'split_row', '$row', 1035406241, 0);||~&~||(1, 'skin_mod', '\n\n
    {$ibforums->lang[\'st_post\']}
    \' class=\'{$row[\'post_css\']}\'>{$row[\'st_top_bit\']}\n
    \n
    {$row[\'post\']}\n
    {$ibforums->lang[\'st_split\']}  
    \n
    \n
    \n \n
    \n
    \n \n\n\n', 'split_end_form', '$action', 1035406242, 0);||~&~||(1, 'skin_mod', '\n\n\n
    {$ibforums->lang[\'mt_new_title\']}
    {$ibforums->lang[\'mt_new_desc\']}
    {$ibforums->lang[\'mt_tid\']}
    \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_modcp_ptitle\']}
    {$ibforums->lang[\'mod_opts\']}: \n base_url}&act=modcp&CODE=showforums\'>{$ibforums->lang[\'menu_forums\']} |\n base_url}&act=modcp&CODE=members\'>{$ibforums->lang[\'menu_users\']} |\n base_url}&act=modcp&CODE=ip\'>{$ibforums->lang[\'menu_ip\']}
    \n
    \n', 'mod_cp_start', '', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'cp_mod_posts_title2\']} $forumname\n
    $pages\n
    \n \' align=\'center\' cellpadding=\'4\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n', 'modtopicview_start', '$tid,$forumname, $fid, $title', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    $title
    \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'cp_mod_posts_title2\']} $forumname\n
    \n \' cellpadding=\'4\' align=\'center\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n \n \n \n', 'modpost_topicstart', '$forumname, $fid', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \n \n \n \n \n \n \n', 'modpost_topicentry', '$title, $tid, $replies, $fid', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    {$ibforums->lang[\'cp_3_title\']}{$ibforums->lang[\'cp_3_replies\']}{$ibforums->lang[\'cp_3_approveall\']}{$ibforums->lang[\'cp_3_viewall\']}
    base_url}&act=ST&f=$fid&t=$tid\' target=\'_blank\'>$title$repliesbase_url}&act=modcp&f=$fid&tid=$tid&CODE=modtopicapprove\'>{$ibforums->lang[\'cp_3_approveall\']}base_url}&act=modcp&f=$fid&tid=$tid&CODE=modtopicview\'>{$ibforums->lang[\'cp_3_viewall\']}
    \n
    \n \n', 'modpost_topicend', '', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\nbase_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'cp_mod_topics_title2\']} $forumname\n
    $pages\n
    \n \n', 'modtopics_start', '$pages,$forumname, $fid', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \' cellpadding=\'4\' align=\'center\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n
    lang[\'cp_1_go\']}\' class=\'forminput\'>
    \n \n \n', 'modtopics_end', '', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \' cellpadding=\'4\' align=\'center\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n \n', 'mod_topic_title', '$title, $topic_id', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n \n \n \n \n \n \n\n', 'mod_postentry', '$data', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \n \n \n\n', 'mod_postentry_checkbox', '$pid', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
       $title
    {$data[\'member\'][\'name\']}

    {$data[\'member\'][\'avatar\']}
    {$data[\'member\'][\'MEMBER_GROUP\']}
    {$data[\'member\'][\'MEMBER_POSTS\']}
    {$data[\'member\'][\'MEMBER_JOINED\']}
    \n {$ibforums->lang[\'posted_on\']} {$data[\'msg\'][\'post_date\']}

    \n \n {$data[\'msg\'][\'post\']}\n \n
      {$ibforums->lang[\'cp_3_postno\']} $pid
    \n
    \n\n', 'mod_topic_spacer', '', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_results\']}\n
    $text
    \n
    \' cellpadding=\'1\' align=\'center\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_check_result\']}\n
    {$ibforums->lang[\'cp_check_text\']}\n
    {$ibforums->lang[\'cp_total_topics\']}$tcount
    {$ibforums->lang[\'cp_total_match\']}$count
    base_url}$link\'>$link_text
    \n
    \n
    \n\n', 'prune_confirm', '$tcount, $count, $link, $link_text', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_prune\']} {$forum[\'name\']}
    {$ibforums->lang[\'cp_prune_text\']}
    \n \n
    \n \n \n \n \n \n \' cellpadding=\'0\' align=\'center\' cellspacing=\'1\' bgcolor=\'<{tbl_border}>\'>\n \n \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_action\']}
    {$ibforums->lang[\'cp_prune_days\']}input[\'dateline\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_prune_type\']}$select
    {$ibforums->lang[\'cp_prune_replies\']}input[\'posts\']}\' class=\'forminput\'>
    {$ibforums->lang[\'cp_prune_member\']}input[\'member\']}\' class=\'forminput\'>
    lang[\'cp_prune_sub1\']}\' class=\'forminput\'>
    \n
    \n
    \n\n', 'prune_splash', '$forum, $forums, $select', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_edit_user\']}: {$profile[\'name\']}
    {$ibforums->lang[\'cp_remove_av\']}
    {$ibforums->lang[\'cp_edit_website\']}
    {$ibforums->lang[\'cp_edit_location\']}
    {$ibforums->lang[\'cp_edit_interests\']}
    {$ibforums->lang[\'cp_edit_signature\']}
    lang[\'cp_find_2_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n\n', 'edit_user_form', '$profile', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_edit_user\']}
    {$ibforums->lang[\'cp_find_2_user\']}$select
    lang[\'cp_find_2_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n\n', 'find_two', '$select', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_edit_user\']}
    {$ibforums->lang[\'cp_find_user\']}
    lang[\'cp_find_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n\n', 'find_user', '', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n
    base_url}\' method=\'POST\'>\n session_id}\'>\n \n \n \n \n \n \n
    {$ibforums->lang[\'ip_desc_text\']}

    {$ibforums->lang[\'ip_warn_text\']}
    \n
    \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'menu_ip\']}
    {$ibforums->lang[\'ip_enter\']}\n .\n .\n .\n  \n \n
    lang[\'ip_submit\']}\' class=\'forminput\'>
    \n
    \n
    \n\n', 'ip_start_form', '$ip_addr', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \n \n \n \n
    $pages
    \n
    \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n\n', 'ip_member_start', '$pages', 1035406242, 0);||~&~||(1, 'skin_modcp', '\n\n \n \n \n \n \n \n \n\n', 'ip_member_row', '$row', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n
    {$ibforums->lang[\'ipm_title\']}
    {$ibforums->lang[\'ipm_name\']}{$ibforums->lang[\'ipm_ip\']}{$ibforums->lang[\'ipm_posts\']}{$ibforums->lang[\'ipm_reg\']}{$ibforums->lang[\'ipm_options\']}
    {$row[\'name\']}{$row[\'ip_address\']}{$row[\'posts\']}{$row[\'joined\']}base_url}&act=Profile&MID={$row[\'id\']}\' target=\'_blank\'>{$ibforums->lang[\'ipm_view\']}\n | base_url}&act=modcp&CODE=doedituser&memberid={$row[\'id\']}\'>{$ibforums->lang[\'ipm_edit\']}
    \n
    \n \n \n \n \n
    $pages
    \n\n', 'ip_member_end', '$pages', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n \n {$ibforums->lang[\'cp_welcome\']}\n \n \n {$ibforums->lang[\'cp_welcome_text\']}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp_mod_in\']}$forum
    {$ibforums->lang[\'cp_topics_wait\']}$tcount
    {$ibforums->lang[\'cp_posts_wait\']}$pcount
    \n \n \n\n', 'splash', '$tcount, $pcount, $forum', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n\n\n \n $words\n \n\n\n', 'mod_exp', '$words', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n\n \n \n \n \n \n \n\n\n', 'end_form', '$action', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n \n \n {$info[\'folder_icon\']}\n {$info[\'name\']}
    {$info[\'description\']}
    {$info[\'moderator\']}\n {$info[\'q_topics\']}\n {$info[\'q_posts\']}\n {$info[\'last_post\']}
    {$ibforums->lang[\'in\']}: {$info[\'last_topic\']}
    {$ibforums->lang[\'by\']}: {$info[\'last_poster\']}\n \n \n \n', 'forum_row', '$info', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n
    base_url}&act=modcp&CODE=fchoice\' method=\'post\'>\n\n \n \n \n
    \n \n', 'forum_page_start', '', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n \n \n \n \n \n \n \n \n \n \n \n', 'cat_row', '$cat_name', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n \n \n \n
    $cat_name
     {$ibforums->lang[\'cat_name\']}{$ibforums->lang[\'f_q_topics\']}{$ibforums->lang[\'f_q_posts\']}{$ibforums->lang[\'last_post_info\']}{$ibforums->lang[\'f_select\']}
    {$ibforums->lang[\'f_w_selected\']}\n  lang[\'f_go\']}\' class=\'forminput\'>\n
    \n
    \n
    \n', 'forum_page_end', '', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\' cellspacing=\'0\' border=\'0\' style=\'border:1px solid <{tbl_border}>\' class=\'row2\'>\n \n \n \n \n \n \n
    $title
    $msg
    \n\n', 'mod_simple_page', '$title="",$msg=""', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n{$ibforums->lang[\'ipp_found\']} $count\n
    \n
    \nbase_url}&act=Search&CODE=show&searchid=$uid&search_in=posts&result_type=posts\'>{$ibforums->lang[\'ipp_click\']}\n\n', 'ip_post_results', '$uid="",$count=""', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n\n\n\' border=\'0\' cellspacing=\'0\' cellpadding=\'4\' align=\'center\'>\n \n \n \n
    $pages
    \n\' align=\'center\' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\'>\n \n base_url}&act=modcp&f={$info[\'id\']}&CODE=topicchoice\' method=\'POST\' name=\'topic\' onSubmit=\'return checkdelete();\'>\n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$info[\'name\']} [ base_url}&act=SF&f={$info[\'id\']}\'>{$ibforums->lang[\'new_show_forum\']} ]
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n', 'start_topics', '$pages,$info', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n \n \n \n', 'show_no_topics', '', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n \n \n \n \n \n \n \n \n \n \n \n \n', 'topic_row', '$Data', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n
    vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'20\' height=\'1\'>vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'20\' height=\'1\'>{$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}{$ibforums->lang[\'f_select\']}
    \n
    \n {$ibforums->lang[\'fv_no_topics\']}\n

    \n
    {$Data[\'folder_img\']}{$Data[\'topic_icon\']}\n {$Data[\'prefix\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&s={$ibforums->session_id}\' class=\'linkthru\' title=\'{$ibforums->lang[\'topic_started_on\']} {$Data[\'start_date\']}\'>{$Data[\'title\']}\n
    {$Data[\'description\']}
    {$Data[\'starter\']}{$Data[\'posts\']}{$Data[\'views\']}{$Data[\'last_post\']}
    {$Data[\'last_text\']} {$Data[\'last_poster\']}
    \n
    \n \n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'t_w_selected\']}\n \n  lang[\'f_go\']}\' class=\'forminput\'>
    \n
    \n
    \n', 'topics_end', '$Data', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n \n {$ibforums->lang[\'cp_tmove_to\']}  \n \n \n lang[\'cp_tmove_end\']}\' class=\'forminput\'>\n \n \n \n \n \n\n', 'move_checked_form_end', '$jump_html', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n\n \n $title\n \n \n', 'move_checked_form_entry', '$tid, $title', 1035406243, 0);||~&~||(1, 'skin_modcp', '\n
    base_url}&act=modcp&CODE=topicchoice&tact=domove&f=$fid\' method=\'post\'>\n\n \n \n \n', 'archive_complete', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'archive_form', '$jump_html=""', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n', 'No_msg_inbox', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n', 'prefs_add_dirs', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n
    \n \n \n \n \n', 'move_checked_form_start', '$forum_name, $fid', 1035406243, 0);||~&~||(1, 'skin_msg', '\n\n \n \n \n\n', 'preview', '$data', 1035406243, 0);||~&~||(1, 'skin_msg', '\n\n \n \n \n\n', 'pm_errors', '$data', 1035406243, 0);||~&~||(1, 'skin_msg', '\n\n\n
    {$ibforums->lang[\'cp_tmove_start\']} $forum_name
    \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'pm_preview\']}
    $data
    \n
    \n
    \n \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'pme_title\']}
    $data

    {$ibforums->lang[\'pme_none_sent\']}
    \n
    \n
    \n\n \n\n\n \n\n\n \n\n
    {$ibforums->lang[\'pmp_title\']}
    $text
    \n {$ibforums->lang[\'pmp_get_last\']}\n

    \n {$ibforums->lang[\'pmp_go_inbox\']} ( {$ibforums->lang[\'pmp_thiswindow\']} )

    {$ibforums->lang[\'pmp_ignore\']}
    \n', 'pm_popup', '$text, $mid', 1035406243, 0);||~&~||(1, 'skin_msg', '\n\n \n Private Message Archive\n \n \n', 'archive_html_header', '', 1035406243, 0);||~&~||(1, 'skin_msg', '\n\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n
    {$info[\'msg_title\']}
    {$info[\'msg_content\']}
    Sent by {$info[\'msg_sender\']} on {$info[\'msg_date\']}
    \n
    \n
    \n', 'archive_html_entry', '$info', 1035406243, 0);||~&~||(1, 'skin_msg', '\n \n\n', 'archive_html_footer', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n
    {$ibforums->lang[\'arc_comp_title\']}
    {$ibforums->lang[\'arc_complete\']}
    {$ibforums->lang[\'archive_title\']}
    {$ibforums->lang[\'archive_text\']}
    \n \n \n \n session_id}\'>\n
    {$ibforums->lang[\'arc_folders\']}$jump_html
    {$ibforums->lang[\'arc_dateline\']}  {$ibforums->lang[\'arc_days\']}
    {$ibforums->lang[\'arc_max\']}
    {$ibforums->lang[\'arc_delete\']}
    {$ibforums->lang[\'arc_type\']}
    {$ibforums->lang[\'inbox_no_msg\']}
    {$ibforums->lang[\'prefs_new\']}
    {$ibforums->lang[\'prefs_text_b\']}
    \n', 'end_address_table', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n {$ibforums->lang[\'address_current\']}\n \n', 'Address_header', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n {$ibforums->lang[\'address_none\']} \n \n', 'Address_none', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n {$ibforums->lang[\'member_edit\']}\n \n \n \n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n
    {$data[MEMBER][\'contact_name\']}{$ibforums->lang[\'enter_desc\']}
    {$ibforums->lang[\'allow_msg\']}
    {$data[SELECT]}
    \n \n \n', 'address_edit', '$data', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$entry[\'contact_id\']}\'>{$entry[\'contact_name\']}    [ {$entry[\'contact_desc\']} ]\n \n [ vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Msg&CODE=11&MID={$entry[\'contact_id\']}\' class=\'misc\'>{$ibforums->lang[\'edit\']} ] :: [ vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Msg&CODE=10&MID={$entry[\'contact_id\']}\'>{$ibforums->lang[\'delete\']} ]\n   ( {$entry[\'text\']} )\n \n \n', 'render_address_row', '$entry', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n {$ibforums->lang[\'member_add\']}\n \n \n \n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'enter_a_name\']}
    {$ibforums->lang[\'enter_desc\']}
    {$ibforums->lang[\'allow_msg\']}
    \n \n \n', 'address_add', '$mem_to_add', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n lang[\'prefs_submit\']}\' class=\'forminput\'>\n \n', 'prefs_footer', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n {$data[EXTRA]}\n \n', 'prefs_row', '$data', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n class[\'SKIN\'][\'TABLE_BORDER_COL\']}\'>\n \n \n \n \n', 'Address_table_header', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n', 'Render_msg', '$data', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n', 'trackread_end', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n', 'trackUNread_end', '', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n', 'unsent_end', '', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'end_inbox', '$vdi_html, $amount_info=""', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n \n \n \n', 'send_form_footer', '', 1035406245, 0);||~&~||(1, 'skin_msg', '\n\n \n \n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'Send_form', '$data', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n', 'mass_pm_box', '$names=""', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n session_id}\'>\n', 'prefs_header', '', 1035406245, 0);||~&~||(1, 'skin_online', '\n
    \n
    {$ibforums->lang[\'member_name\']}{$ibforums->lang[\'enter_block\']}
    {$data[\'msg\'][\'title\']}
    {$data[\'msg\'][\'msg_date\']}
    \n [ base_url}&CODE=04&act=Msg&MSID={$data[\'msg\'][\'msg_id\']}&MID={$data[\'member\'][\'id\']}&fwd=1\'>{$ibforums->lang[\'vm_forward_pm\']} | base_url}&CODE=04&act=Msg&MID={$data[\'member\'][\'id\']}&MSID={$data[\'msg\'][\'msg_id\']}\'>{$ibforums->lang[\'pm_reply_link\']} ]\n
    \n \'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'author\']}\n \n \n \n \n \n
    {$ibforums->lang[\'m_pmessage\']}[ base_url}&CODE=05&act=Msg&MSID={$data[\'msg\'][\'msg_id\']}&VID={$data[\'member\'][\'VID\']}\'>{$ibforums->lang[\'vm_delete_pm\']} ]
    \n
    {$data[\'member\'][\'name\']}
    {$data[\'member\'][\'avatar\']}
    {$data[\'member\'][\'title\']}
    {$data[\'member\'][\'MEMBER_GROUP\']}
    {$data[\'member\'][\'MEMBER_POSTS\']}
    {$data[\'member\'][\'MEMBER_JOINED\']}
    \n \n {$data[\'msg\'][\'message\']}\n {$data[\'member\'][\'signature\']}\n \n
    [ base_url}&CODE=02&act=Msg&MID={$data[\'member\'][\'id\']}\'>{$ibforums->lang[\'add_to_book\']} ]{$data[\'member\'][\'MESSAGE_ICON\']}{$data[\'member\'][\'EMAIL_ICON\']}{$data[\'member\'][\'WEBSITE_ICON\']}{$data[\'member\'][\'ICQ_ICON\']}{$data[\'member\'][\'AOL_ICON\']}{$data[\'member\'][\'YAHOO_ICON\']}
    \n
    \n
    \n
    \n \n \n session_id}\'>\n {$ibforums->lang[goto_folder]}:  {$data[\'jump\']}\n lang[goto_submit]}\' class=\'forminput\'>\n \n
    \n [ base_url}&CODE=04&act=Msg&MSID={$data[\'msg\'][\'msg_id\']}&MID={$data[\'member\'][\'id\']}&fwd=1\'>{$ibforums->lang[\'vm_forward_pm\']} | base_url}&CODE=04&act=Msg&MID={$data[\'member\'][\'id\']}&MSID={$data[\'msg\'][\'msg_id\']}\'>{$ibforums->lang[\'pm_reply_link\']} ]\n
    {$ibforums->lang[\'tk_read_messages\']}
    {$ibforums->lang[\'tk_read_desc\']}
    \n \'>\n \n \n \n \n \n \n \n', 'trackread_table_header', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n', 'trackread_row', '$data', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n
     {$ibforums->lang[\'message_title\']}{$ibforums->lang[\'pms_message_to\']}{$ibforums->lang[\'tk_read_date\']}
    {$data[\'icon\']}{$data[\'title\']}base_url}&act=Profile&MID={$data[\'id\']}\'>{$data[\'to_name\']}{$data[\'date\']}
    lang[\'tk_untrack_button\']}\' class=\'forminput\'> {$ibforums->lang[\'selected_msg\']}
    \n \n
    {$ibforums->lang[\'tk_unread_messages\']}
    {$ibforums->lang[\'tk_unread_desc\']}
    \n \'>\n \n \n \n \n \n \n \n', 'trackUNread_table_header', '', 1035406244, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n', 'trackUNread_row', '$data', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n
     {$ibforums->lang[\'message_title\']}{$ibforums->lang[\'pms_message_to\']}{$ibforums->lang[\'tk_unread_date\']}
    {$data[\'icon\']}{$data[\'title\']}base_url}&act=Profile&MID={$data[\'id\']}\'>{$data[\'to_name\']}{$data[\'date\']}
    lang[\'delete_button\']}\' class=\'forminput\'> {$ibforums->lang[\'selected_msg\']}
    \n \n
    {$ibforums->lang[\'pms_saved_title\']}
    \n \'>\n \n \n \n \n \n \n \n \n', 'unsent_table_header', '', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n \n', 'unsent_row', '$data', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n
     {$ibforums->lang[\'message_title\']}{$ibforums->lang[\'pms_message_to\']}{$ibforums->lang[\'pms_saved_date\']}{$ibforums->lang[\'pms_cc_users\']}
    {$data[\'msg\'][\'icon\']}base_url}&act=Msg&CODE=21&MSID={$data[\'msg\'][\'msg_id\']}\'>{$data[\'msg\'][\'title\']}base_url}&act=Profile&MID={$data[\'msg\'][\'recipient_id\']}\'>{$data[\'msg\'][\'to_name\']}{$data[\'msg\'][\'date\']}{$data[\'msg\'][\'cc_users\']}
    lang[\'delete_button\']}\' class=\'forminput\'> {$ibforums->lang[\'selected_msg\']}
    \n \n
    $dirname
    \n \n \n \n \n \n \n
    \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'300\' height=\'1\'>\n
    \n \'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$info[\'full_messenger\']}
    vars[\'img_url\']}/bar_left.gif\' border=\'0\' width=\'4\' height=\'11\' align=\'middle\' alt=\'\'>vars[\'img_url\']}/bar.gif\' border=\'0\' width=\'{$info[\'img_width\']}\' height=\'11\' align=\'middle\' alt=\'\'>vars[\'img_url\']}/bar_right.gif\' border=\'0\' width=\'4\' height=\'11\' align=\'middle\' alt=\'\'>
    0%50%100%
    \n
    \n
    \n {$ibforums->lang[\'pmpc_mark_read\']} :: {$ibforums->lang[\'pmpc_unmark_all\']}

    \n
    \n {$ibforums->lang[\'goto_folder\']}:   $vdi_html lang[\'goto_submit\']}\' class=\'forminput\'>\n
    \n
    \n
    \n
    \n \'>\n \n \n \n \n \n \n \n', 'inbox_table_header', '$dirname, $info, $vdi_html=""', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n \n \n \n \n', 'inbox_row', '$data', 1035406245, 0);||~&~||(1, 'skin_msg', '\n \n \n \n
     base_url}&act=Msg&CODE=01&VID={$info[\'vid\']}&sort=title\'>{$ibforums->lang[\'message_title\']}base_url}&act=Msg&CODE=01&VID={$info[\'vid\']}&sort=name\'>{$ibforums->lang[\'message_from\']}base_url}&act=Msg&CODE=01&VID={$info[\'vid\']}&sort={$info[\'date_order\']}\'>{$ibforums->lang[\'message_date\']}
    {$data[\'msg\'][\'icon\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Msg&CODE=03&VID={$data[\'stat\'][\'current_id\']}&MSID={$data[\'msg\'][\'msg_id\']}\'>{$data[\'msg\'][\'title\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Profile&MID={$data[\'msg\'][\'from_id\']}\'>{$data[\'msg\'][\'from_name\']} {$data[\'msg\'][\'add_to_contacts\']}{$data[\'msg\'][\'date\']}
    \n lang[\'move_button\']}\' class=\'forminput\'> $vdi_html {$ibforums->lang[\'move_or_delete\']} lang[\'delete_button\']}\' class=\'forminput\'> {$ibforums->lang[\'selected_msg\']}\n
    \n
    \n
    \n <{M_READ}> {$ibforums->lang[\'icon_read\']}\n  <{M_UNREAD}> {$ibforums->lang[\'icon_unread\']}\n $amount_info
    {$ibforums->lang[\'msg_options\']}
     \n  {$ibforums->lang[\'auto_sent_add\']}\n
     {$ibforums->lang[\'vm_track_msg\']}\n
    \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'to_whom\']}
    {$ibforums->lang[\'address_list\']}{$data[CONTACTS]}
    {$ibforums->lang[\'enter_name\']}
    \n
     
    {$ibforums->lang[\'enter_message\']}
    {$ibforums->lang[\'msg_title\']}
    {$ibforums->lang[\'carbon_copy_title\']}
    {$ibforums->lang[\'carbon_copy_desc\']}\n \n \n \n \n \n
    \n lang[\'find_user_names\']}\'>\n
    \n
    {$ibforums->lang[\'prefs_current\']}
    {$ibforums->lang[\'prefs_text_a\']}
    \' align=\'center\'>\n \n \n \n
    {$links[SHOW_PAGES]}
    \n', 'end', '$links', 1035406245, 0);||~&~||(1, 'skin_online', '\n \n \n {$session[\'member_name\']}\n {$session[\'where_line\']}\n {$session[\'running_time\']}\n {$session[\'msg_icon\']}\n \n \n', 'show_row', '$session', 1035406245, 0);||~&~||(1, 'skin_online', '\n \n \n  \n \n \n \n \n \n
    \n \' align=\'center\'>\n \n \n \n
    $links
    \n', 'Page_end', '$links', 1035406245, 0);||~&~||(1, 'skin_online', '\n\n\n\n \' align=\'center\'>\n \n \n \n
    $links
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n
    \n \n \n \n \n \n \n \n', 'Page_header', '$links', 1035406245, 0);||~&~||(1, 'skin_poll', '\n[ {$ibforums->lang[\'ba_edit\']} ]\n', 'edit_link', '$tid, $fid', 1035406246, 0);||~&~||(1, 'skin_poll', '\n[ {$ibforums->lang[\'ba_delete\']} ]\n', 'delete_link', '$tid, $fid', 1035406246, 0);||~&~||(1, 'skin_poll', '\n \n \n \n', 'Render_row_form', '$votes, $id, $answer', 1035406246, 0);||~&~||(1, 'skin_poll', '\n
    {$ibforums->lang[\'member_name\']}{$ibforums->lang[\'where\']}{$ibforums->lang[\'time\']} 
     $answer
    \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n', 'Render_row_results', '$votes, $id, $answer, $percentage, $width', 1035406246, 0);||~&~||(1, 'skin_post', '\n\n\n\n\n\n\n\n\n\n\n', 'table_structure', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n', 'add_edit_box', '$checked=""', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n
    $edit   $delete
    \n \n \n \n \n', 'ShowPoll_header', '$tid, $poll_q, $edit, $delete', 1035406246, 0);||~&~||(1, 'skin_poll', '\n
    $poll_q
    \n \n
    \n \n \n \n \n \n \n \n
    $edit   $delete
    \n \n \n \n \n', 'ShowPoll_Form_header', '$tid, $poll_q, $edit, $delete', 1035406246, 0);||~&~||(1, 'skin_poll', '\n\n
    $poll_q
    \n
    \n $vote_button\n
    \n
    \n
    \n
    \n \n', 'ShowPoll_footer', '$vote_button', 1035406246, 0);||~&~||(1, 'skin_poll', '\n
    $answer [ $votes ] vars[\'img_url\']}/bar_left.gif\' border=\'0\' width=\'4\' height=\'11\' align=\'middle\' alt=\'\'>vars[\'img_url\']}/bar.gif\' border=\'0\' width=\'$width\' height=\'11\' align=\'middle\' alt=\'\'>vars[\'img_url\']}/bar_right.gif\' border=\'0\' width=\'4\' height=\'11\' align=\'middle\' alt=\'\'> [$percentage%]
    {$ibforums->lang[\'edit_ops\']} {$ibforums->lang[\'append_edit\']}
    \n \n \n \n \n \n \n \n
    \n  \n
    \n \n \n \n \n', 'table_top', '$data', 1035406246, 0);||~&~||(1, 'skin_post', '\n base_url}&act=calendar&code=addnewevent\' method=\'POST\' name=\'REPLIER\' onSubmit=\'return ValidateForm()\'>\n', 'calendar_start_form', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n base_url}&act=calendar&code=doedit&eventid=$eventid\' method=\'POST\' name=\'REPLIER\' onSubmit=\'return ValidateForm()\'>\n', 'calendar_start_edit_form', '$eventid', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n', 'calendar_event_title', '$data=""', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n', 'calendar_delete_box', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n', 'calendar_choose_date', '$days, $months, $years', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n', 'calendar_event_type', '$pub_select="", $priv_select=""', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n', 'calendar_admin_group_box', '$groups', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n
    $data
    {$ibforums->lang[\'calendar_title\']}
     {$ibforums->lang[\'calendar_delete_box\']}
    {$ibforums->lang[\'calendar_event_date\']}    
    {$ibforums->lang[\'calendar_event_type\']}
    {$ibforums->lang[\'calendar_group_filter\']}
    \n
    \n', 'calendar_end_form', '$data', 1035406246, 0);||~&~||(1, 'skin_post', '\n
     \n
    \n
    \n', 'EndForm', '$data', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n \n \n \n \n
    vars[\'emo_per_row\']}\' align=\'center\'>{$ibforums->lang[\'click_smilie\']}
    vars[\'emo_per_row\']}\' class=\'row1\' align=\'center\'>{$ibforums->lang[\'all_emoticons\']}
    \n', 'smilie_table', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n \n {$ibforums->lang[\'review_topic\']}\n \n \n \n \n \n \n', 'TopicSummary_bottom', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'post_icon\']}\n \n   \'\'     \'\'     \'\'     \'\'     \'\'     \'\'     \'\'   
    \n   \'\'     \'\'     \'\'     \'\'     \'\'     \'\'     \'\'   \n
    \n   [ Use None ]\n \n \n', 'PostIcons', '', 1035406246, 0);||~&~||(1, 'skin_post', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'errors_found\']}
    \'>$data
    \n
    \n
    \n', 'errors', '$data', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'upload_title\']}\n \n \n {$ibforums->lang[\'upload_text\']} $data\n \n \n', 'Upload_field', '$data', 1035406246, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'upload_title\']}\n \n \n {$ibforums->lang[\'upload_text\']} $data\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'eu_keep\']} ( $file_name )
    {$ibforums->lang[\'eu_delete\']}
    {$ibforums->lang[\'eu_new\']}
    \n \n \n', 'edit_upload_field', '$data, $file_name=""', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'tt_topic_settings\']}\n \n \n {$ibforums->lang[\'topic_title\']}\n \n \n \n {$ibforums->lang[\'topic_desc\']}\n \n \n', 'topictitle_fields', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n {$data[\'author\']}\n {$ibforums->lang[\'posted_on\']} {$data[\'date\']}
    {$data[\'post\']}\n \n', 'TopicSummary_body', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'post_preview\']}
    \'>$data
    \n
    \n
    \n', 'preview', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n\n', 'user_edit', '$info', 1035406247, 0);||~&~||(1, 'skin_profile', '\n
    \n \n \n \n \n \n', 'TopicSummary_top', '', 1035406247, 0);||~&~||(1, 'skin_post', '\n\n', 'nameField_reg', '', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n \n \n \n', 'mod_options', '$jump', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n \n \n \n', 'quote_box', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'postbox_buttons', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n \n \n \n', 'nameField_unreg', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n \n \n \n \n \n \n \n \n \n \n', 'poll_box', '$data, $extra=""', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n
    \n
    {$ibforums->lang[\'last_posts\']}
    {$ibforums->lang[\'tt_options\']}
    {$ibforums->lang[\'mod_options\']}$jump
    {$ibforums->lang[\'post_to_quote\']}
    {$ibforums->lang[\'post_to_quote_txt\']}\n
    {$ibforums->lang[\'ib_code_buttons\']}
    \n  {$ibforums->lang[\'bbcode_guided\']}
    \n  {$ibforums->lang[\'bbcode_normal\']}\n
    \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n   {$ibforums->lang[\'js_close_all_tags\']}\n
    \n \n \n \n \n \n \n \n
    \n {$ibforums->lang[\'hb_open_tags\']}: \n  \n
    \n
    {$ibforums->lang[\'post\']}
    ({$ibforums->lang[\'check_length\']})

    \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'enable_emo\']}
    {$ibforums->lang[\'enable_sig\']}
    {$ibforums->lang[\'unreg_namestuff\']}
    {$ibforums->lang[\'guest_name\']}
    {$ibforums->lang[\'tt_poll_settings\']}
    {$ibforums->lang[\'poll_question\']}
    {$ibforums->lang[\'poll_choices\']}

    $extra
    \n \n \n \n \n \n
    {$ibforums->lang[\'poll_only\']}
    \' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n\n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'tvo_title\']} $title
    \n base_url}&act=Print&client=printer&f=$fid&t=$tid\'>{$ibforums->lang[\'o_print_title\']}\n
    \n {$ibforums->lang[\'o_print_desc\']}\n

    \n base_url}&act=Print&client=html&f=$fid&t=$tid\'>{$ibforums->lang[\'o_html_title\']}\n
    \n {$ibforums->lang[\'o_html_desc\']}\n

    \n base_url}&act=Print&client=wordr&f=$fid&t=$tid\'>{$ibforums->lang[\'o_word_title\']}\n
    \n {$ibforums->lang[\'o_word_desc\']}\n



    \n <<base_url}&act=ST&f=$fid&t=$tid\'>{$ibforums->lang[\'back_topic\']}\n
    \n
    \n\n', 'choose_form', '$fid, $tid, $title', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n \n \n \n \n \n \n \n
    {$ibforums->lang[\'by\']}: {$entry[\'author_name\']} {$ibforums->lang[\'on\']} {$entry[\'post_date\']}
    {$entry[\'post\']}
    \n
    \n', 'pp_postentry', '$poster, $entry', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n
    Powered by Invision Board (http://www.invisionboard.com)
    © Invision Power Services (http://www.invisionpower.com)
    \n', 'pp_end', '', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n \n \n {$ibforums->vars[\'board_name\']} [Powered by IB Forums]\n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'title\']}\n
    base_url}&act=ST&f=$fid&t=$tid\'>{$ibforums->lang[\'topic_here\']}\n
    {$ibforums->vars[\'board_name\']} > $forum_name > $topic_title
    \n
    \n
    \n', 'pp_header', '$forum_name, $topic_title, $topic_starter,$fid, $tid', 1035406247, 0);||~&~||(1, 'skin_profile', '\n
    {$ibforums->lang[\'edit_my_sig\']} |\n {$ibforums->lang[\'edit_avatar\']} |\n {$ibforums->lang[\'edit_profile\']}
    \' align=\'center\'>\n \n \n \n \n \n \n \n
    {$info[\'name\']}
    {$ibforums->lang[\'find_posts\']} |\n {$ibforums->lang[\'add_to_contact\']}
    \n\n\' align=\'center\'>\n \n \n \n
    \n \'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'active_stats\']}
    {$ibforums->lang[\'total_posts\']}{$info[\'posts\']}
    ( {$info[\'total_pct\']}% {$ibforums->lang[\'total_percent\']} )
    {$ibforums->lang[\'posts_per_day\']}{$info[\'posts_day\']}
    {$ibforums->lang[\'joined\']}{$info[\'joined\']}
    {$ibforums->lang[\'fav_forum\']}{$info[\'fav_forum\']}
    {$info[\'fav_posts\']} {$ibforums->lang[\'fav_posts\']}
    ( {$info[\'percent\']}% {$ibforums->lang[\'fav_percent\']} )
    {$ibforums->lang[\'user_local_time\']}{$info[\'local_time\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'communicate\']}
    {$ibforums->lang[\'email\']}{$info[\'email\']}
    {$ibforums->lang[\'aim\']}{$info[\'aim_name\']}
    {$ibforums->lang[\'icq\']}{$info[\'icq_number\']}
    {$ibforums->lang[\'yahoo\']}{$info[\'yahoo\']}
    {$ibforums->lang[\'msn\']}{$info[\'msn_name\']}
    {$ibforums->lang[\'pm\']}{$ibforums->lang[\'click_here\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'info\']}
    {$ibforums->lang[\'homepage\']}{$info[\'homepage\']}
    {$ibforums->lang[\'birthday\']}{$info[\'birthday\']}
    {$ibforums->lang[\'location\']}{$info[\'location\']}
    {$ibforums->lang[\'interests\']}{$info[\'interests\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'post_detail\']}
    {$ibforums->lang[\'mgroup\']}{$info[\'group_title\']}
    {$ibforums->lang[\'mtitle\']}{$info[\'member_title\']}
    {$ibforums->lang[\'avatar\']}{$info[\'avatar\']}
    {$ibforums->lang[\'siggie\']}{$info[\'signature\']}
    \n
    <( {$ibforums->lang[\'back\']} )
    \n
    \n', 'show_profile', '$info', 1035406247, 0);||~&~||(1, 'skin_profile', '\n \n $title\n $value\n \n', 'custom_field', '$title, $value=""', 1035406247, 0);||~&~||(1, 'skin_register', '\n \n \n {$ibforums->lang[\'cpf_title\']}\n \n \n \n \n \n \n \n
    \n {$ibforums->vars[\'board_name\']}: {$ibforums->lang[\'cpf_title\']}\n

    \n {$ibforums->lang[\'cpf_perm_parent\']}\n

    \n {$ibforums->lang[\'cpf_fax\']} {$ibforums->vars[\'coppa_fax\']}\n

    \n {$ibforums->lang[\'cpf_address\']}\n
    \n {$ibforums->vars[\'coppa_address\']}\n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'user_name\']} 
    {$ibforums->lang[\'pass_word\']} 
    {$ibforums->lang[\'email_address\']} 
    \n
    \n \n \n \n \n
    \n {$ibforums->lang[\'cpf_sign\']}\n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cpf_name\']} 
    {$ibforums->lang[\'cpf_relation\']} 
    {$ibforums->lang[\'cpf_signature\']} 
    {$ibforums->lang[\'cpf_email\']} 
    {$ibforums->lang[\'cpf_phone\']} 
    {$ibforums->lang[\'cpf_date\']} 
    \n \n \n', 'coppa_form', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp2_title\']}
    \n {$ibforums->lang[\'cp2_text\']}\n

    \n
    \n << base_url}\'>{$ibforums->lang[\'cp2_cancel\']}\n - base_url}&act=Reg&coppa_pass=1&coppa_user=1\'>{$ibforums->lang[\'cp2_continue\']} >>\n
    \n
    {$ibforums->lang[\'coppa_form\']}
    {$ibforums->lang[\'coppa_form_text\']} vars[\'email_in\']}\'>{$ibforums->vars[\'email_in\']}
    \n
    \n', 'coppa_two', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'coppa_info\']}
    \n

    \n {$ibforums->lang[\'coppa_link\']}\n

    \n < base_url}&act=Reg&coppa_pass=1\'>{$ibforums->lang[\'coppa_date_before\']} $coppadate\n - base_url}&act=Reg&CODE=coppa_two\'>{$ibforums->lang[\'coppa_date_after\']} $coppadate >\n

     \n
    {$ibforums->lang[\'coppa_form\']}
    {$ibforums->lang[\'coppa_form_text\']} vars[\'email_in\']}\'>{$ibforums->vars[\'email_in\']}
    \n
    \n', 'coppa_start', '$coppadate', 1035406247, 0);||~&~||(1, 'skin_register', '\n
    \n
    \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'lp_header\']}

    {$ibforums->lang[\'lp_text\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'lp_user_name\']}
    \n \n
    \n
    \n
    \n', 'lost_pass_form', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'registration_process\']}
    {$ibforums->lang[\'thank_you\']} {$member[\'name\']}. {$ibforums->lang[\'auth_text\']} {$member[\'email\']}
    \n
    \n', 'show_authorise', '$member', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'registration_process\']}
    {$ibforums->lang[\'thank_you\']} {$member[\'name\']}. {$ibforums->lang[\'preview_reg_text\']}
    \n
    \n', 'show_preview', '$member', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n
    \n
    \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'dumb_header\']}

    {$ibforums->lang[\'dumb_text\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'user_id\']}
    {$ibforums->lang[\'val_key\']}
    \n \n
    \n
    \n
    \n', 'show_dumb_form', '$type="reg"', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n
    \n
    \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'reg_header\']}

    {$data[\'TEXT\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'user_name\']}input[\'UserName\']}\' name=\'UserName\' class=\'forminput\'>
    {$ibforums->lang[\'pass_word\']}input[\'PassWord\']}\' name=\'PassWord\' class=\'forminput\'>
    {$ibforums->lang[\'re_enter_pass\']}input[\'PassWord_Check\']}\' name=\'PassWord_Check\' class=\'forminput\'>
    {$ibforums->lang[\'email_address\']}input[\'EmailAddress\']}\' name=\'EmailAddress\' class=\'forminput\'>
    {$ibforums->lang[\'email_address_two\']}input[\'EmailAddress_two\']}\' name=\'EmailAddress_two\' class=\'forminput\'>
    \n
    \n \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'terms_service\']}
    {$ibforums->lang[\'terms_service_text\']}
    \n \n

    {$ibforums->lang[\'agree_submit\']} \n
    \n \n
    \n
    \n
    \n', 'ShowForm', '$data', 1035406248, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'errors_found\']}
    \'>$data
    \n
    \n
    \n', 'errors', '$data', 1035406248, 0);||~&~||(1, 'skin_register', '\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'ras_title\']}
    {$ibforums->lang[\'ras_numbers\']}\n \n base_url}&act=Reg&CODE=image&rc={$regid}&p=1\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=2\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=3\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=4\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=5\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=6\' border=\'0\' alt=\'Code Bit\'>\n
    {$ibforums->lang[\'ras_text\']}
    \n
    \n', 'reg_antispam', '$regid', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n {$ibforums->lang[\'cf_optional\']}\n \n', 'optional_title', '', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n $title
    $desc\n $content\n \n', 'field_entry', '$title, $desc="", $content', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_textinput', '$name, $value=""', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_dropdown', '$name, $options', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_textarea', '$name, $value', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n {$Data[\'folder_img\']}\n {$Data[\'topic_icon\']}\n \n \n \n \n \n \n
    {$Data[\'go_new_post\']}{$Data[\'prefix\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}&s={$ibforums->session_id}\' class=\'linkthru\'>{$Data[\'title\']} {$Data[PAGES]}
    \n {$Data[\'description\']}\n
    {$Data[\'forum_name\']}\n {$Data[\'starter\']}\n {$Data[\'posts\']}\n {$Data[\'views\']}\n {$Data[\'last_post\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&view=getlastpost\'>{$Data[\'last_text\']} {$Data[\'last_poster\']}\n \n \n', 'RenderRow', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n \n \n \n \n \n \n
    {$Data[\'folder_img\']}{$ibforums->lang[\'rp_topic\']} {$Data[\'prefix\']} base_url}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}\' class=\'linkthru\'>{$Data[\'title\']} {$Data[PAGES]}
    \n \n \n \n {$Data[\'author_name\']}\n \n {$ibforums->lang[\'rp_forum\']} {$Data[\'forum_name\']}    {$ibforums->lang[\'rp_postedon\']} {$Data[\'post_date\']}    {$ibforums->lang[\'rp_post\']} base_url}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}&#entry{$Data[\'pid\']}\' class=\'linkthru\'>#{$Data[\'pid\']}\n \n \n \n \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'150\' height=\'15\'>\n
    \n {$ibforums->lang[\'rp_replies\']} {$Data[\'posts\']}
    {$ibforums->lang[\'rp_hits\']} {$Data[\'views\']}
    \n \n {$Data[\'post\']}\n \n \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'1\' height=\'1\'>\n \n \n', 'RenderPostRow', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    \n \n \n \n \n \n', 'start_as_post', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
    {$ibforums->lang[\'rp_author\']}{$ibforums->lang[\'rp_message\']}
     
    \n
    \n
    \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    <{B_NEW}> {$ibforums->lang[\'pm_open_new\']}<{B_HOT}> {$ibforums->lang[\'pm_hot_new\']}<{B_POLL}> {$ibforums->lang[\'pm_poll\']}<{B_LOCKED}> {$ibforums->lang[\'pm_locked\']}
    <{B_NORM}> {$ibforums->lang[\'pm_open_no\']}<{B_HOT_NN}> {$ibforums->lang[\'pm_hot_no\']}<{B_POLL_NN}> {$ibforums->lang[\'pm_poll_no\']}<{B_MOVED}> {$ibforums->lang[\'pm_moved\']}
    \n', 'end_as_post', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n  \n \n \n \n \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    <{B_NEW}> {$ibforums->lang[\'pm_open_new\']}<{B_HOT}> {$ibforums->lang[\'pm_hot_new\']}<{B_POLL}> {$ibforums->lang[\'pm_poll\']}<{B_LOCKED}> {$ibforums->lang[\'pm_locked\']}
    <{B_NORM}> {$ibforums->lang[\'pm_open_no\']}<{B_HOT_NN}> {$ibforums->lang[\'pm_hot_no\']}<{B_POLL_NN}> {$ibforums->lang[\'pm_poll_no\']}<{B_MOVED}> {$ibforums->lang[\'pm_moved\']}
    \n', 'end', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n \n
    \n $hidden_fields\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'keywords_title\']}
    {$ibforums->lang[\'key_search\']}{$ibforums->lang[\'mem_search\']}


    {$ibforums->lang[\'keysearch_text\']}
    \n \n \n \n \n \n \n \n
    \n  {$ibforums->lang[\'match_name_ex\']}\n
     {$ibforums->lang[\'match_name_pa\']}\n
    \n  {$ibforums->lang[\'joinname_true\']}\n
     {$ibforums->lang[\'joinname_false\']}\n
    \n
    \n
    \n \n \n
    \n \n \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'search_options\']}
    {$ibforums->lang[\'search_where\']}{$ibforums->lang[\'search_refine\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
     {$ibforums->lang[\'search_cats\']}$cats
     {$ibforums->lang[\'search_forums\']}$forums
     {$ibforums->lang[\'in_posts\']}
     {$ibforums->lang[\'in_topics\']}
     {$ibforums->lang[\'results_topics\']}
     {$ibforums->lang[\'results_post\']}
    \n
    \n \n \n \n \n \n
    \n {$ibforums->lang[\'search_from\']}\n
    \n \n
    {$ibforums->lang[\'and\']} \'> {$ibforums->lang[\'older\']} \' checked> {$ibforums->lang[\'newer\']}\n
    \n {$ibforums->lang[\'sort_results\']}
    \n \n
    {$ibforums->lang[\'descending\']}\n
    {$ibforums->lang[\'ascending\']}\n
    \n
    lang[\'do_search\']}\' class=\'forminput\'>
    \n
    \n
    \n \n', 'Form', '$forums, $cats', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
    \n \' align=\'center\'>\n \n \n \n \n
    {$ibforums->lang[\'active_topics\']}
    {$Data[SHOW_PAGES]}
    \n
    base_url}&act=Search&CODE=getactive\' method=\'POST\' name=\'dateline\' onSubmit=\'return checkvalues();\'>\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'splash', '$member', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'settings_header', '$Profile, $time_select, $time, $dst_check', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n', 'skin_lang_header', '$lang_select', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n', 'settings_skin', '$skin', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'skin_lang_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'settings_end', '$data', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'email', '$Profile', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n\n', 'forum_subs_end', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n \n \n \n \n \n \n', 'subs_end', '$text="", $days=""', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n
    \n
    \n {$ibforums->lang[\'active_st_text\']}\n \n   {$ibforums->lang[\'active_end_text\']}  \n \n   \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'RenderRow', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n\n\n
    \n \n \n \n \n \n \n \n \n \n \n', 'active_start', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
     {$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_forum_name\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}
    \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n
    \n \n \n \n \n \n', 'top_poster_no_info', '', 1035406249, 0);||~&~||(1, 'skin_topic', '\nbase_url}&act=report&f={$data[\'forum_id\']}&t={$data[\'topic_id\']}&p={$data[\'pid\']}&st={$ibforums->input[\'st\']}\'>{$ibforums->lang[\'snitch_geezer_to_a_copper\']}\n', 'report_link', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n{$ibforums->lang[\'ip\']}: $data\n', 'ip_show', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n( base_url}&act=ST&f=$fid&t=$tid&view=getnewpost\'>{$ibforums->lang[\'go_new_post\']} )\n', 'golastpost_link', '$fid, $tid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\'>\n session_id}\'>\n \n \n input[\'st\']}\'>\n \n  lang[\'jmp_go\']}\' class=\'forminput\' />\n \n', 'Mod_Panel', '$data, $fid, $tid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n\n', 'mod_wrapper', '$id="", $text=""', 1035406249, 0);||~&~||(1, 'skin_topic', '\n
    \n \n \n \n \n \n \n \n \n \n \n', 'start', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n\n', 'active_none', '', 1035406248, 0);||~&~||(1, 'skin_stats', '\n\n\n
     {$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_forum_name\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}
    {$ibforums->lang[\'active_no_topics\']}
    \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n', 'who_header', '$fid, $tid, $title', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n', 'who_row', '$row', 1035406248, 0);||~&~||(1, 'skin_stats', '\n base_url}&act=Profile&MID=$id\' target=\'_blank\'>$name\n \n', 'who_name_link', '$id, $name', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \n \n \n
    {$ibforums->lang[\'who_farted\']} $title
    {$ibforums->lang[\'who_poster\']}{$ibforums->lang[\'who_posts\']}
    {$row[\'author_name\']}{$row[\'pcount\']}
    {$ibforums->lang[\'who_go\']}
    \n
    \n', 'who_end', '', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \' align=\'center\'>\n \n \n \n
    {$title}
    \n', 'page_title', '$title', 1035406248, 0);||~&~||(1, 'skin_stats', '\n\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n', 'group_strip', '$group', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n \n \n', 'leader_row', '$info, $forums', 1035406249, 0);||~&~||(1, 'skin_stats', '\n
    $group
    {$ibforums->lang[\'leader_name\']}{$ibforums->lang[\'leader_forums\']}{$ibforums->lang[\'leader_location\']} 
    base_url}&act=Profile&MID={$info[\'id\']}\'>{$info[\'name\']}$forums{$info[\'location\']}{$info[\'msg_icon\']}
    \n
    \n
    \n', 'close_strip', '', 1035406249, 0);||~&~||(1, 'skin_stats', '\n\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n', 'top_poster_header', '', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n \n \n \n', 'top_poster_row', '$info', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n
    {$ibforums->lang[\'member\']}{$ibforums->lang[\'member_joined\']}{$ibforums->lang[\'member_posts\']}{$ibforums->lang[\'member_today\']}{$ibforums->lang[\'member_percent\']}
    base_url}&act=Profile&MID={$info[\'id\']}\'>{$info[\'name\']}{$info[\'joined\']}{$info[\'posts\']}{$info[\'tpost\']}{$info[\'today_pct\']}%
    {$ibforums->lang[\'total_today\']} $info
    \n
    \n', 'top_poster_footer', '$info', 1035406249, 0);||~&~||(1, 'skin_stats', '\n
    {$ibforums->lang[\'no_info\']}
    \n \n \n \n \n \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'topic_stats\']}base_url}&act=Track&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'track_topic\']} |\n base_url}&act=Forward&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'forward\']} |\n base_url}&act=Print&client=printer&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'print\']}
    \n
    \n
    \n\' align=\'center\' border=\'0\' cellspacing=\'0\' cellpadding=\'4\'>\n \n \n \n \n
    {$data[TOPIC][SHOW_PAGES]}\n
    << vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=SF&f={$data[\'FORUM\'][\'id\']}\'>Back to {$data[\'FORUM\'][\'name\']}
    {$data[TOPIC][REPLY_BUTTON]}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM][\'id\']}\' title=\'{$ibforums->lang[\'start_new_topic\']}\'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}
    \n
    \n\' align=\'center\' border=\'0\' cellspacing=\'0\' cellpadding=\'3\'>\n \n \n \n \n
    \n \n {$data[FORUM][\'JUMP\']}

    \n
    \n', 'TableFooter', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n \n \n \n
    \n base_url}&act=Track&f=$fid&t=$tid\'>{$ibforums->lang[\'tt_title\']}\n
    {$ibforums->lang[\'tt_desc\']}\n

    \n base_url}&act=Track&f=$fid&type=forum\'>{$ibforums->lang[\'ft_title\']}\n
    {$ibforums->lang[\'ft_desc\']}\n

    \n base_url}&act=Print&client=choose&f=$fid&t=$tid\'>{$ibforums->lang[\'av_title\']}\n
    {$ibforums->lang[\'av_desc\']}\n
    \n', 'email_options', '$tid, $fid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n
    {$data[POSTER][\'name\']}\n \n \n \n \n \n
    {$data[POST][\'post_icon\']}{$ibforums->lang[\'posted_on\']} {$data[POST][\'post_date\']}{$data[POST][\'delete_button\']}{$data[POST][\'edit_button\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=06&f={$ibforums->input[f]}&t={$ibforums->input[t]}&p={$data[POST][\'pid\']}\'><{P_QUOTE}>
    \n
    \n {$data[POSTER][\'avatar\']}

    \n {$data[POSTER][\'title\']}
    \n {$data[POSTER][\'member_rank_img\']}

    \n {$data[POSTER][\'member_group\']}
    \n {$data[POSTER][\'member_posts\']}
    \n {$data[POSTER][\'member_number\']}
    \n {$data[POSTER][\'member_joined\']}
    \n {$data[POSTER][WARN_GFX]}

    \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'160\' height=\'1\'>
    \n
    {$data[POST][\'post\']} {$data[POST][\'attachment\']} {$data[POST][\'signature\']}
    {$data[POST][\'ip_address\']} \n \n \n \n \n \n \n
    {$data[POSTER][\'message_icon\']}{$data[POSTER][\'email_icon\']}{$data[POSTER][\'website_icon\']}{$data[POSTER][\'icq_icon\']}{$data[POSTER][\'aol_icon\']}{$data[POSTER][\'yahoo_icon\']}{$data[POSTER][\'msn_icon\']}{$data[POST][\'report_link\']} vars[\'img_url\']}/p_up.gif\' alt=\'Top\' border=\'0\'>
    \n
    vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'1\' height=\'1\'>
    \' border=\'0\' cellspacing=\'0\' cellpadding=\'4\' align=\'center\'>\n \n \n \n \n
    {$data[\'TOPIC\'][\'SHOW_PAGES\']} {$data[\'TOPIC\'][\'go_new\']}{$data[TOPIC][REPLY_BUTTON]}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM][\'id\']}\' title=\'{$ibforums->lang[\'start_new_topic\']}\'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}
    \n\' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n \n \n', 'birthday', '$day,$month,$year', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'email_change', '$txt=""', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'pass_change', '', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n', 'personal_splash', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'member_title', '$title', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\' method=\'post\' onload=\'checkTheBox\' $formextra name=\'creator\'>\n \n \n session_id}\'>\n $hidden_field\n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar', '$data, $formextra="", $hidden_field=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'avatar_upload_field', '$text=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar_URL', '$Profile, $avatar, $allowed_ext', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'personal_splash_av', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'signature', '$sig, $t_sig', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n\n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_panel', '$Profile', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'required_title', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'field_entry', '$title, $desc="", $content', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_textinput', '$name, $value=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_dropdown', '$name, $options', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_textarea', '$name, $value', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n
    \n
    \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$data[\'TOPIC\'][\'title\']}{$data[\'TOPIC\'][\'description\']}
    \n
    \n \n \n \n \n \n\n\n', 'PageTop', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n
    \n \n \n \n \n \n
    « vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM][\'id\']}&t={$data[TOPIC][\'tid\']}&view=old\'>{$ibforums->lang[\'t_old\']} | vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM][\'id\']}&t={$data[TOPIC][\'tid\']}&view=new\'>{$ibforums->lang[\'t_new\']} »\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Track&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'track_topic\']} |\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Forward&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'forward\']} |\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Print&client=printer&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'print\']}
    \n
    \n \n \n \n \n \n \n
    {$ibforums->lang[\'active_users_title\']} ({$ibforums->lang[\'active_users_detail\']})
    {$ibforums->lang[\'active_users_members\']} {$active[\'names\']}
    \n \n\n', 'topic_active_users', '$active=array()', 1035406249, 0);||~&~||(1, 'skin_topic', '\n

    {$ibforums->lang[\'pic_attach\']}

    \n\n \n \n \n
    vars[\'upload_url\']}/{$data[\'file_name\']}\' border=\'0\' alt=\'{$ibforums->lang[\'pic_attach\']}\'>
    \n

    \n', 'Show_attachments_img', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n

    \n \n \n \n \n \n \n \n \n
    vars[\'mime_img\']}/{$data[\'image\']}\' border=\'0\' alt=\'User Attached Image\'>vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Attach&type=post&id={$data[\'pid\']}\' target=\'_blank\'>{$ibforums->lang[\'attach_dl\']}
    {$data[\'name\']} ( {$ibforums->lang[\'attach_hits\']}: {$data[\'hits\']} )
    \n

    \n', 'Show_attachments', '$data', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n

    {$ibforums->lang[\'birthday\']}\n \n \n \n
    {$ibforums->lang[\'change_email_title\']}
    $txt
    {$ibforums->lang[\'ce_new_email\']}
    {$ibforums->lang[\'ce_new_email2\']}
    {$ibforums->lang[\'account_pass_title\']}
    {$ibforums->lang[\'pass_change_text\']}
    {$ibforums->lang[\'account_pass_old\']}
    {$ibforums->lang[\'account_pass_new\']}
    {$ibforums->lang[\'account_pass_new2\']}
    {$ibforums->lang[\'personal_ops\']}
    {$ibforums->member[\'name\']}, {$ibforums->lang[\'personal_ops_txt\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=2\'>{$ibforums->lang[\'edit_profile\']}

    {$ibforums->lang[\'edit_profile_txt\']}
    {$ibforums->lang[\'member_title\']}
    {$ibforums->lang[\'av_current\']}
    {$ibforums->lang[\'this_avatar\']}{$data[CUR_AV]}
    {$ibforums->lang[\'avatar_pre_title\']}
    {$ibforums->lang[\'avatar_pre_txt\']}{$data[AVATARS]}     {$data[SHOW_AVS]}
    {$ibforums->lang[\'upload_avatar\']}
    $text
    {$ibforums->lang[\'avatar_url_title\']}
    {$ibforums->lang[\'avatar\']}
    {$ibforums->lang[\'avatar_url_ext\']}
    $allowed_ext
    {$ibforums->lang[\'avatar_dims\']}
    {$ibforums->lang[\'maximum\']} {$ibforums->lang[\'width\']} = {$ibforums->vars[\'av_width\']} {$ibforums->lang[\'pixels\']}
    {$ibforums->lang[\'maximum\']} {$ibforums->lang[\'height\']} = {$ibforums->vars[\'av_height\']} {$ibforums->lang[\'pixels\']})
    {$ibforums->lang[\'width\']}     x   {$ibforums->lang[\'height\']}  
    {$ibforums->lang[\'av_tt_one\']}
    {$ibforums->lang[\'av_tt_two\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=1\'>{$ibforums->lang[\'avatar_ops\']}

    {$ibforums->lang[\'avatar_ops_txt\']}
    {$ibforums->lang[\'cp_current_sig\']}
    \n \n \n \n \n
    $sig
    \n
    {$ibforums->lang[\'cp_edit_sig\']}
    \n  {$ibforums->lang[\'bbcode_guided\']}
    \n  {$ibforums->lang[\'bbcode_normal\']}\n
    \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n   {$ibforums->lang[\'js_close_all_tags\']}\n
    \n \n \n \n \n \n \n \n
    \n \n
    \n {$ibforums->lang[\'hb_open_tags\']}: \n
    \n

    ({$ibforums->lang[\'check_length\']})
    lang[\'cp_submit_sig\']}\'>
    {$ibforums->lang[\'profile_title\']}
    {$ibforums->lang[\'website\']}
    {$ibforums->lang[\'icq\']}
    {$ibforums->lang[\'aol\']}
    {$ibforums->lang[\'yahoo\']}
    {$ibforums->lang[\'msn\']}
    {$ibforums->lang[\'location\']}
    ({$ibforums->lang[\'check_length\']})
    {$ibforums->lang[\'interests\']}
    ({$ibforums->lang[\'check_length\']})
    \n \n
    {$ibforums->lang[\'cf_required\']}
    $title
    $desc
    $content
    \' bgcolor=\'<{tbl_border}>\' align=\'center\' border="0" cellspacing="1" cellpadding="0">\n \n \n \n \n \n \n
    \n  \n
    \n \n \n \n \n \n \n \n \n \n
      
    \n \n \n \n \n
    \n \n {$ibforums->lang[\'m_messenger\']}
    \n
    \n • {$ibforums->lang[\'mess_inbox\']}
    \n • {$ibforums->lang[\'mess_new\']}
    \n • {$ibforums->lang[\'mess_contact\']}
    \n • {$ibforums->lang[\'mess_folders\']}
    \n • {$ibforums->lang[\'mess_archive\']}
    \n • {$ibforums->lang[\'mess_saved\']}
    \n • {$ibforums->lang[\'mess_tracker\']}
    \n
    \n \n \n \n {$ibforums->lang[\'m_tracker\']}
    \n
    \n • {$ibforums->lang[\'m_view_subs\']}
    \n • {$ibforums->lang[\'m_view_forum\']}
    \n
    \n \n \n {$ibforums->lang[\'m_personal\']}
    \n
    \n • {$ibforums->lang[\'m_contact_info\']}
    \n \n • {$ibforums->lang[\'m_sig_info\']}
    \n • {$ibforums->lang[\'m_avatar_info\']}
    \n \n \n
    \n {$ibforums->lang[\'m_options\']}
    \n
    \n • {$ibforums->lang[\'m_email_opt\']}
    \n • {$ibforums->lang[\'m_board_opt\']}
    \n • {$ibforums->lang[\'m_skin_lang\']}
    \n • {$ibforums->lang[\'m_email_change\']}
    \n • {$ibforums->lang[\'m_passy_opt\']}
    \n \n \n
    \n
    \n \n \n \n \n', 'Menu_bar', '$base_url', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n
    \n
    \n
    \n', 'CP_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n
    {$ibforums->lang[\'stats_header\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'email_address\']}{$member[MEMBER_EMAIL]}
    {$ibforums->lang[\'number_posts\']}{$member[MEMBER_POSTS]}
    {$ibforums->lang[\'registered\']}{$member[DATE_REGISTERED]}
    {$ibforums->lang[\'daily_average\']}{$member[DAILY_AVERAGE]}
    \n
    {$ibforums->lang[\'messenger_summary\']}
    \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'total_messages\']}{$member[\'total_messages\']} {$member[\'full_percent\']}
    {$ibforums->lang[\'messages_left\']}{$member[\'space_free\']} {$member[\'full_messenger\']}
    \n
    {$ibforums->lang[\'note_pad\']}
    \n
    \n \n session_id}\'>\n \n \n \n \n \n
    \n \n
    \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'ta_size\']}  \n \n lang[\'submit_notepad\']}\' class=\'forminput\'>\n
    \n
    \n
    {$ibforums->lang[\'settings_time\']}
    {$ibforums->lang[\'settings_time_txt\']}
    $time
    $time_select
    {$ibforums->lang[\'dst_box\']}
    {$ibforums->lang[\'settings_title\']}
    {$ibforums->lang[\'settings_lang_txt\']}$lang_select
    {$ibforums->lang[\'settings_skin\']}
    {$ibforums->lang[\'settings_skin_txt\']}$skin    lang[\'cp_skin_preview\']}\' class=\'forminput\' onClick=\'do_preview()\'>
    lang[\'settings_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'settings_display\']}
    {$ibforums->lang[\'settings_viewsig\']}{$data[SIG]}
    {$ibforums->lang[\'settings_viewimg\']}{$data[IMG]}
    {$ibforums->lang[\'settings_viewava\']}{$data[AVA]}
    {$ibforums->lang[\'settings_dopopup\']}{$data[POP]}
    {$ibforums->lang[\'hide_session_txt\']}{$data[SESS]}
    {$ibforums->lang[\'pp_number_posts\']}
    {$ibforums->lang[\'pp_number_topics\']}
    lang[\'settings_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'privacy_settings\']}
    {$ibforums->lang[\'hide_email\']}
    {$ibforums->lang[\'admin_send\']}
    {$ibforums->lang[\'board_prefs\']}
    {$ibforums->lang[\'send_full_msg\']}
    {$ibforums->lang[\'pm_reminder\']}
    {$ibforums->lang[\'auto_track\']}
    \n \n
    {$ibforums->lang[\'forum_subs_header\']}
    \n \'>\n \n \n \n \n \n \n \n', 'forum_subs_header', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n', 'forum_subs_row', '$data', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'forum_subs_none', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n\n
     {$ibforums->lang[\'ft_forum\']}{$ibforums->lang[\'ft_topics\']}{$ibforums->lang[\'ft_posts\']}{$ibforums->lang[\'ft_last_post\']}
    {$data[\'folder_icon\']}\n base_url}&act=SF&f={$data[\'id\']}\'>{$data[\'name\']}\n
    {$data[\'description\']}\n

    [ base_url}&act=UserCP&CODE=51&f={$data[\'id\']}\'>{$ibforums->lang[\'ft_unsub\']} ]\n
    {$data[\'topics\']}{$data[\'posts\']}{$data[\'last_post\']}
    {$ibforums->lang[\'in\']} {$data[\'last_topic\']}
    {$ibforums->lang[\'by\']} {$data[\'last_poster\']}
    {$ibforums->lang[\'forum_subs_none\']}
    base_url}&act=UserCP&CODE=51&f=all\'>{$ibforums->lang[\'ft_unsub_all\']}
    \n
    {$ibforums->lang[\'subs_header\']}\n
    \n \n \n session_id}\'>\n
    \n \'>\n \n \n \n \n \n \n \n \n', 'subs_header', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n', 'subs_row', '$data', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'subs_none', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'subs_forum_row', '$fid, $fname', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n\n\n
     {$ibforums->lang[\'subs_topic\']}{$ibforums->lang[\'subs_replies\']}{$ibforums->lang[\'subs_view\']}{$ibforums->lang[\'subs_last_post\']}
    {$data[\'folder_icon\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[\'forum_id\']}&t={$data[\'tid\']}\'>{$data[\'title\']} ( vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[\'forum_id\']}&t={$data[\'tid\']}\' target=\'_blank\'>{$ibforums->lang[\'new_window\']} )
    {$data[\'description\']}{$ibforums->lang[\'subs_start\']} {$data[\'start_date\']}
    {$data[\'posts\']}{$data[\'views\']}{$data[\'last_post_date\']}
    {$ibforums->lang[\'subs_by\']} {$data[\'last_poster\']}
    {$ibforums->lang[\'subs_none\']}
    base_url}&act=SF&f=$fid\'>$fname
    lang[\'subs_delete\']}\'>  {$ibforums->lang[\'with_selected\']}
    \n
    \n\' cellpadding=\'2\' cellspacing=\'0\' align=\'center\'>\n\n \n\n\n \n\n
    $text
    \n
    base_url}&act=UserCP&CODE=26\' method=\'post\'>\n {$ibforums->lang[\'show_topics_from\']} \n lang[\'jmp_go\']}\'>\n
    \n
    \n
    \' align=\'center\'>\n \n \n \n \n
    \n
    \n \n
    \n
    {$data}
    \n
    \n', 'forum_jump', '$data, $menu_extra=""', 1035406251, 0);||~&~||(1, 'skin_post', '\n\n \n {$ibforums->lang[\'ib_code_buttons\']}\n \n \n \n  {$ibforums->lang[\'bbcode_guided\']}
    \n  {$ibforums->lang[\'bbcode_normal\']}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n   {$ibforums->lang[\'js_close_all_tags\']}\n
    \n \n \n \n \n \n \n \n
    \n {$ibforums->lang[\'hb_open_tags\']}: \n  \n
    \n \n \n \n {$ibforums->lang[\'post\']}\n \n \n ({$ibforums->lang[\'check_length\']})

    \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'enable_emo\']}
    {$ibforums->lang[\'enable_sig\']}
    \n \n', 'pm_postbox_buttons', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'unreg_namestuff\']}\n \n \n {$ibforums->lang[\'guest_name\']}\n \n \n', 'nameField_unreg', '$data', 1035406247, 0);||~&~||(1, 'skin_post', '\n \n {$ibforums->lang[\'tt_poll_settings\']}\n \n \n {$ibforums->lang[\'poll_question\']}\n \n \n \n {$ibforums->lang[\'poll_choices\']}

    $extra\n \n \n \n \n \n \n
    {$ibforums->lang[\'poll_only\']}
    \n \n', 'poll_box', '$data, $extra=""', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n
    \n\' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n\n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'tvo_title\']} $title
    \n base_url}&act=Print&client=printer&f=$fid&t=$tid\'>{$ibforums->lang[\'o_print_title\']}\n
    \n {$ibforums->lang[\'o_print_desc\']}\n

    \n base_url}&act=Print&client=html&f=$fid&t=$tid\'>{$ibforums->lang[\'o_html_title\']}\n
    \n {$ibforums->lang[\'o_html_desc\']}\n

    \n base_url}&act=Print&client=wordr&f=$fid&t=$tid\'>{$ibforums->lang[\'o_word_title\']}\n
    \n {$ibforums->lang[\'o_word_desc\']}\n



    \n <<base_url}&act=ST&f=$fid&t=$tid\'>{$ibforums->lang[\'back_topic\']}\n
    \n
    \n\n', 'choose_form', '$fid, $tid, $title', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n \n \n \n \n \n \n \n
    {$ibforums->lang[\'by\']}: {$entry[\'author_name\']} {$ibforums->lang[\'on\']} {$entry[\'post_date\']}
    {$entry[\'post\']}
    \n
    \n', 'pp_postentry', '$poster, $entry', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n
    Powered by Invision Board (http://www.invisionboard.com)
    © Invision Power Services (http://www.invisionpower.com)
    \n', 'pp_end', '', 1035406247, 0);||~&~||(1, 'skin_printpage', '\n \n \n {$ibforums->vars[\'board_name\']} [Powered by IB Forums]\n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'title\']}\n
    base_url}&act=ST&f=$fid&t=$tid\'>{$ibforums->lang[\'topic_here\']}\n
    {$ibforums->vars[\'board_name\']} > $forum_name > $topic_title
    \n
    \n
    \n', 'pp_header', '$forum_name, $topic_title, $topic_starter,$fid, $tid', 1035406247, 0);||~&~||(1, 'skin_profile', '\n\n {$ibforums->lang[\'edit_my_sig\']} |\n {$ibforums->lang[\'edit_avatar\']} |\n {$ibforums->lang[\'edit_profile\']}\n\n', 'user_edit', '$info', 1035406247, 0);||~&~||(1, 'skin_profile', '\n\' align=\'center\'>\n \n \n \n \n \n \n \n
    {$info[\'name\']}
    {$ibforums->lang[\'find_posts\']} |\n {$ibforums->lang[\'add_to_contact\']}
    \n\n\' align=\'center\'>\n \n \n \n
    \n \'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'active_stats\']}
    {$ibforums->lang[\'total_posts\']}{$info[\'posts\']}
    ( {$info[\'total_pct\']}% {$ibforums->lang[\'total_percent\']} )
    {$ibforums->lang[\'posts_per_day\']}{$info[\'posts_day\']}
    {$ibforums->lang[\'joined\']}{$info[\'joined\']}
    {$ibforums->lang[\'fav_forum\']}{$info[\'fav_forum\']}
    {$info[\'fav_posts\']} {$ibforums->lang[\'fav_posts\']}
    ( {$info[\'percent\']}% {$ibforums->lang[\'fav_percent\']} )
    {$ibforums->lang[\'user_local_time\']}{$info[\'local_time\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'communicate\']}
    {$ibforums->lang[\'email\']}{$info[\'email\']}
    {$ibforums->lang[\'aim\']}{$info[\'aim_name\']}
    {$ibforums->lang[\'icq\']}{$info[\'icq_number\']}
    {$ibforums->lang[\'yahoo\']}{$info[\'yahoo\']}
    {$ibforums->lang[\'msn\']}{$info[\'msn_name\']}
    {$ibforums->lang[\'pm\']}{$ibforums->lang[\'click_here\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'info\']}
    {$ibforums->lang[\'homepage\']}{$info[\'homepage\']}
    {$ibforums->lang[\'birthday\']}{$info[\'birthday\']}
    {$ibforums->lang[\'location\']}{$info[\'location\']}
    {$ibforums->lang[\'interests\']}{$info[\'interests\']}
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'post_detail\']}
    {$ibforums->lang[\'mgroup\']}{$info[\'group_title\']}
    {$ibforums->lang[\'mtitle\']}{$info[\'member_title\']}
    {$ibforums->lang[\'avatar\']}{$info[\'avatar\']}
    {$ibforums->lang[\'siggie\']}{$info[\'signature\']}
    \n
    <( {$ibforums->lang[\'back\']} )
    \n
    \n', 'show_profile', '$info', 1035406247, 0);||~&~||(1, 'skin_profile', '\n \n $title\n $value\n \n', 'custom_field', '$title, $value=""', 1035406247, 0);||~&~||(1, 'skin_register', '\n \n \n {$ibforums->lang[\'cpf_title\']}\n \n \n \n \n \n \n \n
    \n {$ibforums->vars[\'board_name\']}: {$ibforums->lang[\'cpf_title\']}\n

    \n {$ibforums->lang[\'cpf_perm_parent\']}\n

    \n {$ibforums->lang[\'cpf_fax\']} {$ibforums->vars[\'coppa_fax\']}\n

    \n {$ibforums->lang[\'cpf_address\']}\n
    \n {$ibforums->vars[\'coppa_address\']}\n \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'user_name\']} 
    {$ibforums->lang[\'pass_word\']} 
    {$ibforums->lang[\'email_address\']} 
    \n
    \n \n \n \n \n
    \n {$ibforums->lang[\'cpf_sign\']}\n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cpf_name\']} 
    {$ibforums->lang[\'cpf_relation\']} 
    {$ibforums->lang[\'cpf_signature\']} 
    {$ibforums->lang[\'cpf_email\']} 
    {$ibforums->lang[\'cpf_phone\']} 
    {$ibforums->lang[\'cpf_date\']} 
    \n \n \n', 'coppa_form', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'cp2_title\']}
    \n {$ibforums->lang[\'cp2_text\']}\n

    \n
    \n << base_url}\'>{$ibforums->lang[\'cp2_cancel\']}\n - base_url}&act=Reg&coppa_pass=1&coppa_user=1\'>{$ibforums->lang[\'cp2_continue\']} >>\n
    \n
    {$ibforums->lang[\'coppa_form\']}
    {$ibforums->lang[\'coppa_form_text\']} vars[\'email_in\']}\'>{$ibforums->vars[\'email_in\']}
    \n
    \n', 'coppa_two', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'coppa_info\']}
    \n

    \n {$ibforums->lang[\'coppa_link\']}\n

    \n < base_url}&act=Reg&coppa_pass=1\'>{$ibforums->lang[\'coppa_date_before\']} $coppadate\n - base_url}&act=Reg&CODE=coppa_two\'>{$ibforums->lang[\'coppa_date_after\']} $coppadate >\n

     \n
    {$ibforums->lang[\'coppa_form\']}
    {$ibforums->lang[\'coppa_form_text\']} vars[\'email_in\']}\'>{$ibforums->vars[\'email_in\']}
    \n
    \n', 'coppa_start', '$coppadate', 1035406247, 0);||~&~||(1, 'skin_register', '\n
    \n
    \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'lp_header\']}

    {$ibforums->lang[\'lp_text\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'lp_user_name\']}
    \n \n
    \n
    \n
    \n', 'lost_pass_form', '', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'registration_process\']}
    {$ibforums->lang[\'thank_you\']} {$member[\'name\']}. {$ibforums->lang[\'auth_text\']} {$member[\'email\']}
    \n
    \n', 'show_authorise', '$member', 1035406247, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'registration_process\']}
    {$ibforums->lang[\'thank_you\']} {$member[\'name\']}. {$ibforums->lang[\'preview_reg_text\']}
    \n
    \n', 'show_preview', '$member', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n
    \n
    \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'dumb_header\']}

    {$ibforums->lang[\'dumb_text\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'user_id\']}
    {$ibforums->lang[\'val_key\']}
    \n \n
    \n
    \n
    \n', 'show_dumb_form', '$type="reg"', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n
    \n
    \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$ibforums->lang[\'reg_header\']}

    {$data[\'TEXT\']}
    \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'complete_form\']}
    {$ibforums->lang[\'user_name\']}input[\'UserName\']}\' name=\'UserName\' class=\'forminput\'>
    {$ibforums->lang[\'pass_word\']}input[\'PassWord\']}\' name=\'PassWord\' class=\'forminput\'>
    {$ibforums->lang[\'re_enter_pass\']}input[\'PassWord_Check\']}\' name=\'PassWord_Check\' class=\'forminput\'>
    {$ibforums->lang[\'email_address\']}input[\'EmailAddress\']}\' name=\'EmailAddress\' class=\'forminput\'>
    {$ibforums->lang[\'email_address_two\']}input[\'EmailAddress_two\']}\' name=\'EmailAddress_two\' class=\'forminput\'>
    \n
    \n \n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n
    \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'terms_service\']}
    {$ibforums->lang[\'terms_service_text\']}
    \n \n

    {$ibforums->lang[\'agree_submit\']} \n
    \n \n
    \n
    \n
    \n', 'ShowForm', '$data', 1035406248, 0);||~&~||(1, 'skin_register', '\n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    {$ibforums->lang[\'errors_found\']}
    \'>$data
    \n
    \n
    \n', 'errors', '$data', 1035406248, 0);||~&~||(1, 'skin_register', '\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'ras_title\']}
    {$ibforums->lang[\'ras_numbers\']}\n \n base_url}&act=Reg&CODE=image&rc={$regid}&p=1\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=2\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=3\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=4\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=5\' border=\'0\' alt=\'Code Bit\'>\n  base_url}&act=Reg&CODE=image&rc={$regid}&p=6\' border=\'0\' alt=\'Code Bit\'>\n
    {$ibforums->lang[\'ras_text\']}
    \n
    \n', 'reg_antispam', '$regid', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n {$ibforums->lang[\'cf_optional\']}\n \n', 'optional_title', '', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n $title
    $desc\n $content\n \n', 'field_entry', '$title, $desc="", $content', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_textinput', '$name, $value=""', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_dropdown', '$name, $options', 1035406248, 0);||~&~||(1, 'skin_register', '\n \n', 'field_textarea', '$name, $value', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n {$Data[\'folder_img\']}\n {$Data[\'topic_icon\']}\n \n \n \n \n \n \n
    {$Data[\'go_new_post\']}{$Data[\'prefix\']} vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}&s={$ibforums->session_id}\' class=\'linkthru\'>{$Data[\'title\']} {$Data[PAGES]}
    \n {$Data[\'description\']}\n {$Data[\'forum_name\']}\n {$Data[\'starter\']}\n {$Data[\'posts\']}\n {$Data[\'views\']}\n {$Data[\'last_post\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&view=getlastpost\'>{$Data[\'last_text\']} {$Data[\'last_poster\']}\n \n \n', 'RenderRow', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n \n \n \n \n \n \n
    {$Data[\'folder_img\']}{$ibforums->lang[\'rp_topic\']} {$Data[\'prefix\']} base_url}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}\' class=\'linkthru\'>{$Data[\'title\']} {$Data[PAGES]}
    \n \n \n \n {$Data[\'author_name\']}\n \n {$ibforums->lang[\'rp_forum\']} {$Data[\'forum_name\']}    {$ibforums->lang[\'rp_postedon\']} {$Data[\'post_date\']}    {$ibforums->lang[\'rp_post\']} base_url}&act=ST&f={$Data[\'forum_id\']}&t={$Data[\'tid\']}&hl={$Data[\'keywords\']}&#entry{$Data[\'pid\']}\' class=\'linkthru\'>#{$Data[\'pid\']}\n \n \n \n \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'150\' height=\'15\'>\n
    \n {$ibforums->lang[\'rp_replies\']} {$Data[\'posts\']}
    {$ibforums->lang[\'rp_hits\']} {$Data[\'views\']}
    \n \n {$Data[\'post\']}\n \n \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'1\' height=\'1\'>\n \n \n', 'RenderPostRow', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n
    \n \n \n \n \n \n', 'start_as_post', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
    {$ibforums->lang[\'rp_author\']}{$ibforums->lang[\'rp_message\']}
     
    \n
    \n
    \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    <{B_NEW}> {$ibforums->lang[\'pm_open_new\']}<{B_HOT}> {$ibforums->lang[\'pm_hot_new\']}<{B_POLL}> {$ibforums->lang[\'pm_poll\']}<{B_LOCKED}> {$ibforums->lang[\'pm_locked\']}
    <{B_NORM}> {$ibforums->lang[\'pm_open_no\']}<{B_HOT_NN}> {$ibforums->lang[\'pm_hot_no\']}<{B_POLL_NN}> {$ibforums->lang[\'pm_poll_no\']}<{B_MOVED}> {$ibforums->lang[\'pm_moved\']}
    \n', 'end_as_post', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n  \n \n \n \n \n \n \n \n \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    <{B_NEW}> {$ibforums->lang[\'pm_open_new\']}<{B_HOT}> {$ibforums->lang[\'pm_hot_new\']}<{B_POLL}> {$ibforums->lang[\'pm_poll\']}<{B_LOCKED}> {$ibforums->lang[\'pm_locked\']}
    <{B_NORM}> {$ibforums->lang[\'pm_open_no\']}<{B_HOT_NN}> {$ibforums->lang[\'pm_hot_no\']}<{B_POLL_NN}> {$ibforums->lang[\'pm_poll_no\']}<{B_MOVED}> {$ibforums->lang[\'pm_moved\']}
    \n', 'end', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n \n \n
    \n $hidden_fields\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'keywords_title\']}
    {$ibforums->lang[\'key_search\']}{$ibforums->lang[\'mem_search\']}


    {$ibforums->lang[\'keysearch_text\']}
    \n \n \n \n \n \n \n \n
    \n  {$ibforums->lang[\'match_name_ex\']}\n
     {$ibforums->lang[\'match_name_pa\']}\n
    \n  {$ibforums->lang[\'joinname_true\']}\n
     {$ibforums->lang[\'joinname_false\']}\n
    \n
    \n
    \n \n \n
    \n \n \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'search_options\']}
    {$ibforums->lang[\'search_where\']}{$ibforums->lang[\'search_refine\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
     {$ibforums->lang[\'search_cats\']}$cats
     {$ibforums->lang[\'search_forums\']}$forums
     {$ibforums->lang[\'in_posts\']}
     {$ibforums->lang[\'in_topics\']}
     {$ibforums->lang[\'results_topics\']}
     {$ibforums->lang[\'results_post\']}
    \n
    \n \n \n \n \n \n
    \n {$ibforums->lang[\'search_from\']}\n
    \n \n
    {$ibforums->lang[\'and\']} \'> {$ibforums->lang[\'older\']} \' checked> {$ibforums->lang[\'newer\']}\n
    \n {$ibforums->lang[\'sort_results\']}
    \n \n
    {$ibforums->lang[\'descending\']}\n
    {$ibforums->lang[\'ascending\']}\n
    \n
    lang[\'do_search\']}\' class=\'forminput\'>
    \n
    \n
    \n \n', 'Form', '$forums, $cats', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
    \n \' align=\'center\'>\n \n \n \n \n
    {$ibforums->lang[\'active_topics\']}
    {$Data[SHOW_PAGES]}
    \n
    base_url}&act=Search&CODE=getactive\' method=\'POST\' name=\'dateline\' onSubmit=\'return checkvalues();\'>\n
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'splash', '$member', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'settings_header', '$Profile, $time_select, $time, $dst_check', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n', 'skin_lang_header', '$lang_select', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n', 'settings_skin', '$skin', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'skin_lang_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'settings_end', '$data', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'email', '$Profile', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n\n', 'forum_subs_end', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n \n \n \n \n \n \n', 'subs_end', '$text="", $days=""', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n
    \n
    \n {$ibforums->lang[\'active_st_text\']}\n \n   {$ibforums->lang[\'active_end_text\']}  \n \n   \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'RenderRow', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n\n\n
    \n \n \n \n \n \n \n \n \n \n \n', 'active_start', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n \n
     {$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_forum_name\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}
    \' align=\'center\'>\n \n \n \n
    {$Data[SHOW_PAGES]}
    \n \' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n
    \n \n \n \n \n \n', 'top_poster_no_info', '', 1035406249, 0);||~&~||(1, 'skin_topic', '\nbase_url}&act=report&f={$data[\'forum_id\']}&t={$data[\'topic_id\']}&p={$data[\'pid\']}&st={$ibforums->input[\'st\']}\'>{$ibforums->lang[\'snitch_geezer_to_a_copper\']}\n', 'report_link', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n{$ibforums->lang[\'ip\']}: $data\n', 'ip_show', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n( base_url}&act=ST&f=$fid&t=$tid&view=getnewpost\'>{$ibforums->lang[\'go_new_post\']} )\n', 'golastpost_link', '$fid, $tid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\'>\n session_id}\'>\n \n \n input[\'st\']}\'>\n \n  lang[\'jmp_go\']}\' class=\'forminput\' />\n \n', 'Mod_Panel', '$data, $fid, $tid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n\n', 'mod_wrapper', '$id="", $text=""', 1035406249, 0);||~&~||(1, 'skin_topic', '\n
    \n \n \n \n \n \n \n \n \n \n \n', 'start', '$Data', 1035406248, 0);||~&~||(1, 'skin_search', '\n\n', 'active_none', '', 1035406248, 0);||~&~||(1, 'skin_stats', '\n\n\n
     {$ibforums->lang[\'h_topic_title\']}{$ibforums->lang[\'h_forum_name\']}{$ibforums->lang[\'h_topic_starter\']}{$ibforums->lang[\'h_replies\']}{$ibforums->lang[\'h_hits\']}{$ibforums->lang[\'h_last_action\']}
    {$ibforums->lang[\'active_no_topics\']}
    \' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n', 'who_header', '$fid, $tid, $title', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n', 'who_row', '$row', 1035406248, 0);||~&~||(1, 'skin_stats', '\n base_url}&act=Profile&MID=$id\' target=\'_blank\'>$name\n \n', 'who_name_link', '$id, $name', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \n \n \n
    {$ibforums->lang[\'who_farted\']} $title
    {$ibforums->lang[\'who_poster\']}{$ibforums->lang[\'who_posts\']}
    {$row[\'author_name\']}{$row[\'pcount\']}
    {$ibforums->lang[\'who_go\']}
    \n
    \n', 'who_end', '', 1035406248, 0);||~&~||(1, 'skin_stats', '\n \' align=\'center\'>\n \n \n \n
    {$title}
    \n', 'page_title', '$title', 1035406248, 0);||~&~||(1, 'skin_stats', '\n\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n', 'group_strip', '$group', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n \n \n', 'leader_row', '$info, $forums', 1035406249, 0);||~&~||(1, 'skin_stats', '\n
    $group
    {$ibforums->lang[\'leader_name\']}{$ibforums->lang[\'leader_forums\']}{$ibforums->lang[\'leader_location\']} 
    base_url}&act=Profile&MID={$info[\'id\']}\'>{$info[\'name\']}$forums{$info[\'location\']}{$info[\'msg_icon\']}
    \n
    \n
    \n', 'close_strip', '', 1035406249, 0);||~&~||(1, 'skin_stats', '\n\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n
    \n \n \n \n \n \n \n \n \n', 'top_poster_header', '', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n \n \n \n \n', 'top_poster_row', '$info', 1035406249, 0);||~&~||(1, 'skin_stats', '\n \n \n \n
    {$ibforums->lang[\'member\']}{$ibforums->lang[\'member_joined\']}{$ibforums->lang[\'member_posts\']}{$ibforums->lang[\'member_today\']}{$ibforums->lang[\'member_percent\']}
    base_url}&act=Profile&MID={$info[\'id\']}\'>{$info[\'name\']}{$info[\'joined\']}{$info[\'posts\']}{$info[\'tpost\']}{$info[\'today_pct\']}%
    {$ibforums->lang[\'total_today\']} $info
    \n
    \n', 'top_poster_footer', '$info', 1035406249, 0);||~&~||(1, 'skin_stats', '\n
    {$ibforums->lang[\'no_info\']}
    \n \n \n \n \n \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'topic_stats\']}base_url}&act=Track&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'track_topic\']} |\n base_url}&act=Forward&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'forward\']} |\n base_url}&act=Print&client=printer&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'print\']}
    \n
    \n
    \n\' align=\'center\' border=\'0\' cellspacing=\'0\' cellpadding=\'4\'>\n \n \n \n \n
    {$data[TOPIC][SHOW_PAGES]}\n
    << vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=SF&f={$data[\'FORUM\'][\'id\']}\'>Back to {$data[\'FORUM\'][\'name\']}
    {$data[TOPIC][REPLY_BUTTON]}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM][\'id\']}\' title=\'{$ibforums->lang[\'start_new_topic\']}\'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}
    \n
    \n\' align=\'center\' border=\'0\' cellspacing=\'0\' cellpadding=\'3\'>\n \n \n \n \n
    \n \n {$data[FORUM][\'JUMP\']}

    \n
    \n', 'TableFooter', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n \n \n \n
    \n base_url}&act=Track&f=$fid&t=$tid\'>{$ibforums->lang[\'tt_title\']}\n
    {$ibforums->lang[\'tt_desc\']}\n

    \n base_url}&act=Track&f=$fid&type=forum\'>{$ibforums->lang[\'ft_title\']}\n
    {$ibforums->lang[\'ft_desc\']}\n

    \n base_url}&act=Print&client=choose&f=$fid&t=$tid\'>{$ibforums->lang[\'av_title\']}\n
    {$ibforums->lang[\'av_desc\']}\n
    \n', 'email_options', '$tid, $fid', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n
    {$data[POSTER][\'name\']}\n \n \n \n \n \n
    {$data[POST][\'post_icon\']}{$ibforums->lang[\'posted_on\']} {$data[POST][\'post_date\']}{$data[POST][\'delete_button\']}{$data[POST][\'edit_button\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=06&f={$ibforums->input[f]}&t={$ibforums->input[t]}&p={$data[POST][\'pid\']}\'><{P_QUOTE}>
    \n
    \n {$data[POSTER][\'avatar\']}

    \n {$data[POSTER][\'title\']}
    \n {$data[POSTER][\'member_rank_img\']}

    \n {$data[POSTER][\'member_group\']}
    \n {$data[POSTER][\'member_posts\']}
    \n {$data[POSTER][\'member_number\']}
    \n {$data[POSTER][\'member_joined\']}
    \n {$data[POSTER][WARN_GFX]}

    \n vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'160\' height=\'1\'>
    \n
    {$data[POST][\'post\']} {$data[POST][\'attachment\']} {$data[POST][\'signature\']}
    {$data[POST][\'ip_address\']} \n \n \n \n \n \n \n
    {$data[POSTER][\'message_icon\']}{$data[POSTER][\'email_icon\']}{$data[POSTER][\'website_icon\']}{$data[POSTER][\'icq_icon\']}{$data[POSTER][\'aol_icon\']}{$data[POSTER][\'yahoo_icon\']}{$data[POSTER][\'msn_icon\']}{$data[POST][\'report_link\']} vars[\'img_url\']}/p_up.gif\' alt=\'Top\' border=\'0\'>
    \n
    vars[\'img_url\']}/spacer.gif\' alt=\'\' width=\'1\' height=\'1\'>
    \' border=\'0\' cellspacing=\'0\' cellpadding=\'4\' align=\'center\'>\n \n \n \n \n
    {$data[\'TOPIC\'][\'SHOW_PAGES\']} {$data[\'TOPIC\'][\'go_new\']}{$data[TOPIC][REPLY_BUTTON]}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Post&CODE=00&f={$data[FORUM][\'id\']}\' title=\'{$ibforums->lang[\'start_new_topic\']}\'><{A_POST}>{$data[TOPIC][POLL_BUTTON]}
    \n\' border=\'0\' cellspacing=\'1\' cellpadding=\'0\' bgcolor=\'<{tbl_border}>\' align=\'center\'>\n \n \n \n \n \n \n \n \n', 'birthday', '$day,$month,$year', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'email_change', '$txt=""', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'pass_change', '', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n', 'personal_splash', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'member_title', '$title', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}\' method=\'post\' onload=\'checkTheBox\' $formextra name=\'creator\'>\n \n \n session_id}\'>\n $hidden_field\n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar', '$data, $formextra="", $hidden_field=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'avatar_upload_field', '$text=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar_URL', '$Profile, $avatar, $allowed_ext', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n \n \n', 'personal_avatar_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'personal_splash_av', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n\n \n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'signature', '$sig, $t_sig', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n\n\n \n \n session_id}\'>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n', 'personal_panel', '$Profile', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'required_title', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n', 'field_entry', '$title, $desc="", $content', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_textinput', '$name, $value=""', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_dropdown', '$name, $options', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n', 'field_textarea', '$name, $value', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n
    \n
    \n \n \n \n \n \n
    vars[\'img_url\']}/nav_m.gif\' alt=\'\' width=\'8\' height=\'8\'>{$data[\'TOPIC\'][\'title\']}{$data[\'TOPIC\'][\'description\']}
    \n
    \n \n \n \n \n \n\n\n', 'PageTop', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n \n
    \n \n \n \n \n \n
    « vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM][\'id\']}&t={$data[TOPIC][\'tid\']}&view=old\'>{$ibforums->lang[\'t_old\']} | vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[FORUM][\'id\']}&t={$data[TOPIC][\'tid\']}&view=new\'>{$ibforums->lang[\'t_new\']} »\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Track&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'track_topic\']} |\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Forward&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'forward\']} |\n vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Print&client=printer&f={$data[\'FORUM\'][\'id\']}&t={$data[\'TOPIC\'][\'tid\']}\'>{$ibforums->lang[\'print\']}
    \n
    \n \n \n \n \n \n \n
    {$ibforums->lang[\'active_users_title\']} ({$ibforums->lang[\'active_users_detail\']})
    {$ibforums->lang[\'active_users_members\']} {$active[\'names\']}
    \n \n\n', 'topic_active_users', '$active=array()', 1035406249, 0);||~&~||(1, 'skin_topic', '\n

    {$ibforums->lang[\'pic_attach\']}

    \n\n \n \n \n
    vars[\'upload_url\']}/{$data[\'file_name\']}\' border=\'0\' alt=\'{$ibforums->lang[\'pic_attach\']}\'>
    \n

    \n', 'Show_attachments_img', '$data', 1035406249, 0);||~&~||(1, 'skin_topic', '\n

    \n \n \n \n \n \n \n \n \n
    vars[\'mime_img\']}/{$data[\'image\']}\' border=\'0\' alt=\'User Attached Image\'>vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=Attach&type=post&id={$data[\'pid\']}\' target=\'_blank\'>{$ibforums->lang[\'attach_dl\']}
    {$data[\'name\']} ( {$ibforums->lang[\'attach_hits\']}: {$data[\'hits\']} )
    \n

    \n', 'Show_attachments', '$data', 1035406249, 0);||~&~||(1, 'skin_ucp', '\n

    {$ibforums->lang[\'birthday\']}\n \n \n \n
    {$ibforums->lang[\'change_email_title\']}
    $txt
    {$ibforums->lang[\'ce_new_email\']}
    {$ibforums->lang[\'ce_new_email2\']}
    {$ibforums->lang[\'account_pass_title\']}
    {$ibforums->lang[\'pass_change_text\']}
    {$ibforums->lang[\'account_pass_old\']}
    {$ibforums->lang[\'account_pass_new\']}
    {$ibforums->lang[\'account_pass_new2\']}
    {$ibforums->lang[\'personal_ops\']}
    {$ibforums->member[\'name\']}, {$ibforums->lang[\'personal_ops_txt\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=2\'>{$ibforums->lang[\'edit_profile\']}

    {$ibforums->lang[\'edit_profile_txt\']}
    {$ibforums->lang[\'member_title\']}
    {$ibforums->lang[\'av_current\']}
    {$ibforums->lang[\'this_avatar\']}{$data[CUR_AV]}
    {$ibforums->lang[\'avatar_pre_title\']}
    {$ibforums->lang[\'avatar_pre_txt\']}{$data[AVATARS]}     {$data[SHOW_AVS]}
    {$ibforums->lang[\'upload_avatar\']}
    $text
    {$ibforums->lang[\'avatar_url_title\']}
    {$ibforums->lang[\'avatar\']}
    {$ibforums->lang[\'avatar_url_ext\']}
    $allowed_ext
    {$ibforums->lang[\'avatar_dims\']}
    {$ibforums->lang[\'maximum\']} {$ibforums->lang[\'width\']} = {$ibforums->vars[\'av_width\']} {$ibforums->lang[\'pixels\']}
    {$ibforums->lang[\'maximum\']} {$ibforums->lang[\'height\']} = {$ibforums->vars[\'av_height\']} {$ibforums->lang[\'pixels\']})
    {$ibforums->lang[\'width\']}     x   {$ibforums->lang[\'height\']}  
    {$ibforums->lang[\'av_tt_one\']}
    {$ibforums->lang[\'av_tt_two\']}
    vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=UserCP&CODE=01&MODE=1\'>{$ibforums->lang[\'avatar_ops\']}

    {$ibforums->lang[\'avatar_ops_txt\']}
    {$ibforums->lang[\'cp_current_sig\']}
    \n \n \n \n \n
    $sig
    \n
    {$ibforums->lang[\'cp_edit_sig\']}
    \n  {$ibforums->lang[\'bbcode_guided\']}
    \n  {$ibforums->lang[\'bbcode_normal\']}\n
    \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n   {$ibforums->lang[\'js_close_all_tags\']}\n
    \n \n \n \n \n \n \n \n
    \n \n
    \n {$ibforums->lang[\'hb_open_tags\']}: \n
    \n

    ({$ibforums->lang[\'check_length\']})
    lang[\'cp_submit_sig\']}\'>
    {$ibforums->lang[\'profile_title\']}
    {$ibforums->lang[\'website\']}
    {$ibforums->lang[\'icq\']}
    {$ibforums->lang[\'aol\']}
    {$ibforums->lang[\'yahoo\']}
    {$ibforums->lang[\'msn\']}
    {$ibforums->lang[\'location\']}
    ({$ibforums->lang[\'check_length\']})
    {$ibforums->lang[\'interests\']}
    ({$ibforums->lang[\'check_length\']})
    \n \n
    {$ibforums->lang[\'cf_required\']}
    $title
    $desc
    $content
    \' bgcolor=\'<{tbl_border}>\' align=\'center\' border="0" cellspacing="1" cellpadding="0">\n \n \n \n \n \n \n
    \n  \n
    \n \n \n \n \n \n \n \n \n \n
      
    \n \n \n \n \n
    \n \n {$ibforums->lang[\'m_messenger\']}
    \n
    \n • {$ibforums->lang[\'mess_inbox\']}
    \n • {$ibforums->lang[\'mess_new\']}
    \n • {$ibforums->lang[\'mess_contact\']}
    \n • {$ibforums->lang[\'mess_folders\']}
    \n • {$ibforums->lang[\'mess_archive\']}
    \n • {$ibforums->lang[\'mess_saved\']}
    \n • {$ibforums->lang[\'mess_tracker\']}
    \n
    \n \n \n \n {$ibforums->lang[\'m_tracker\']}
    \n
    \n • {$ibforums->lang[\'m_view_subs\']}
    \n • {$ibforums->lang[\'m_view_forum\']}
    \n
    \n \n \n {$ibforums->lang[\'m_personal\']}
    \n
    \n • {$ibforums->lang[\'m_contact_info\']}
    \n \n • {$ibforums->lang[\'m_sig_info\']}
    \n • {$ibforums->lang[\'m_avatar_info\']}
    \n \n \n
    \n {$ibforums->lang[\'m_options\']}
    \n
    \n • {$ibforums->lang[\'m_email_opt\']}
    \n • {$ibforums->lang[\'m_board_opt\']}
    \n • {$ibforums->lang[\'m_skin_lang\']}
    \n • {$ibforums->lang[\'m_email_change\']}
    \n • {$ibforums->lang[\'m_passy_opt\']}
    \n \n \n
    \n
    \n \n \n \n \n', 'Menu_bar', '$base_url', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n \n \n
    \n
    \n
    \n', 'CP_end', '', 1035406250, 0);||~&~||(1, 'skin_ucp', '\n
    {$ibforums->lang[\'stats_header\']}
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'email_address\']}{$member[MEMBER_EMAIL]}
    {$ibforums->lang[\'number_posts\']}{$member[MEMBER_POSTS]}
    {$ibforums->lang[\'registered\']}{$member[DATE_REGISTERED]}
    {$ibforums->lang[\'daily_average\']}{$member[DAILY_AVERAGE]}
    \n
    {$ibforums->lang[\'messenger_summary\']}
    \n \n \n \n \n \n \n \n \n \n
    {$ibforums->lang[\'total_messages\']}{$member[\'total_messages\']} {$member[\'full_percent\']}
    {$ibforums->lang[\'messages_left\']}{$member[\'space_free\']} {$member[\'full_messenger\']}
    \n
    {$ibforums->lang[\'note_pad\']}
    \n
    \n \n session_id}\'>\n \n \n \n \n \n
    \n \n
    \n
    \n \n \n \n \n \n
    {$ibforums->lang[\'ta_size\']}  \n \n lang[\'submit_notepad\']}\' class=\'forminput\'>\n
    \n
    \n
    {$ibforums->lang[\'settings_time\']}
    {$ibforums->lang[\'settings_time_txt\']}
    $time
    $time_select
    {$ibforums->lang[\'dst_box\']}
    {$ibforums->lang[\'settings_title\']}
    {$ibforums->lang[\'settings_lang_txt\']}$lang_select
    {$ibforums->lang[\'settings_skin\']}
    {$ibforums->lang[\'settings_skin_txt\']}$skin    lang[\'cp_skin_preview\']}\' class=\'forminput\' onClick=\'do_preview()\'>
    lang[\'settings_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'settings_display\']}
    {$ibforums->lang[\'settings_viewsig\']}{$data[SIG]}
    {$ibforums->lang[\'settings_viewimg\']}{$data[IMG]}
    {$ibforums->lang[\'settings_viewava\']}{$data[AVA]}
    {$ibforums->lang[\'settings_dopopup\']}{$data[POP]}
    {$ibforums->lang[\'hide_session_txt\']}{$data[SESS]}
    {$ibforums->lang[\'pp_number_posts\']}
    {$ibforums->lang[\'pp_number_topics\']}
    lang[\'settings_submit\']}\' class=\'forminput\'>
    {$ibforums->lang[\'privacy_settings\']}
    {$ibforums->lang[\'hide_email\']}
    {$ibforums->lang[\'admin_send\']}
    {$ibforums->lang[\'board_prefs\']}
    {$ibforums->lang[\'send_full_msg\']}
    {$ibforums->lang[\'pm_reminder\']}
    {$ibforums->lang[\'auto_track\']}
    \n \n
    {$ibforums->lang[\'forum_subs_header\']}
    \n \'>\n \n \n \n \n \n \n \n', 'forum_subs_header', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n', 'forum_subs_row', '$data', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'forum_subs_none', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n\n
     {$ibforums->lang[\'ft_forum\']}{$ibforums->lang[\'ft_topics\']}{$ibforums->lang[\'ft_posts\']}{$ibforums->lang[\'ft_last_post\']}
    {$data[\'folder_icon\']}\n base_url}&act=SF&f={$data[\'id\']}\'>{$data[\'name\']}\n
    {$data[\'description\']}\n

    [ base_url}&act=UserCP&CODE=51&f={$data[\'id\']}\'>{$ibforums->lang[\'ft_unsub\']} ]\n
    {$data[\'topics\']}{$data[\'posts\']}{$data[\'last_post\']}
    {$ibforums->lang[\'in\']} {$data[\'last_topic\']}
    {$ibforums->lang[\'by\']} {$data[\'last_poster\']}
    {$ibforums->lang[\'forum_subs_none\']}
    base_url}&act=UserCP&CODE=51&f=all\'>{$ibforums->lang[\'ft_unsub_all\']}
    \n
    {$ibforums->lang[\'subs_header\']}\n
    \n \n \n session_id}\'>\n
    \n \'>\n \n \n \n \n \n \n \n \n', 'subs_header', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n \n \n \n \n \n', 'subs_row', '$data', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'subs_none', '', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n \n \n \n', 'subs_forum_row', '$fid, $fname', 1035406251, 0);||~&~||(1, 'skin_ucp', '\n\n \n\n\n
     {$ibforums->lang[\'subs_topic\']}{$ibforums->lang[\'subs_replies\']}{$ibforums->lang[\'subs_view\']}{$ibforums->lang[\'subs_last_post\']}
    {$data[\'folder_icon\']}vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[\'forum_id\']}&t={$data[\'tid\']}\'>{$data[\'title\']} ( vars[\'board_url\']}/index.{$ibforums->vars[\'php_ext\']}?s={$ibforums->session_id}&act=ST&f={$data[\'forum_id\']}&t={$data[\'tid\']}\' target=\'_blank\'>{$ibforums->lang[\'new_window\']} )
    {$data[\'description\']}{$ibforums->lang[\'subs_start\']} {$data[\'start_date\']}
    {$data[\'posts\']}{$data[\'views\']}{$data[\'last_post_date\']}
    {$ibforums->lang[\'subs_by\']} {$data[\'last_poster\']}
    {$ibforums->lang[\'subs_none\']}
    base_url}&act=SF&f=$fid\'>$fname
    lang[\'subs_delete\']}\'>  {$ibforums->lang[\'with_selected\']}
    \n
    \n\' cellpadding=\'2\' cellspacing=\'0\' align=\'center\'>\n\n \n\n\n \n\n
    $text
    \n
    base_url}&act=UserCP&CODE=26\' method=\'post\'>\n {$ibforums->lang[\'show_topics_from\']} \n lang[\'jmp_go\']}\'>\n
    \n
    \n
    \' align=\'center\'>\n \n \n \n \n
    \n
    \n \n
    \n
    {$data}
    \n
    \n', 'forum_jump', '$data, $menu_extra=""', 1035406251, 0);||~&~||||~&~|| \ No newline at end of file diff --git a/upload/lang/en/ReportWords.php b/upload/lang/en/ReportWords.php deleted file mode 100644 index 7c57e601..00000000 --- a/upload/lang/en/ReportWords.php +++ /dev/null @@ -1,17 +0,0 @@ - "Send report now", -message => "Your message", -title => "Report a post to a moderator", -redirect => "Report sent, returning you to the topic you came from", -in_topic => "Topic Title", -subject => "Mailer from Invision Board: Reporting post", -in_forum => "Reported in forum", -ibauto => "Invision Board Bot", -warn => "This form is for reporting abusive behaviour (spamming, rude posts, etc) ONLY.
    DO NOT use this form just to contact a moderator - these messages will be ignored!", -email => "Your email", -name => "Your name", -); -?> \ No newline at end of file diff --git a/upload/lang/en/email_content.php b/upload/lang/en/email_content.php index 2e87e1f8..88d29809 100644 --- a/upload/lang/en/email_content.php +++ b/upload/lang/en/email_content.php @@ -1,283 +1,357 @@ - - -From, - -<#USER NAME#> - -EOF; - -$EMAIL['pm_archive'] = <<, -This email has been sent from <#BOARD_ADDRESS#>. - -Your archived messages have been compiled into a single -file and has been attached to this message. - -EOF; - -$EMAIL['reg_validate'] = <<, -This email has been sent from <#BOARD_ADDRESS#>. - -You have received this email because this email address -was used during registration for our forums. -If you did not register at our forums, please disregard this -email. You do not need to unsubscribe or take any further action. - ------------------------------------------------- - ACTIVATION INSTRUCTIONS BELOW ------------------------------------------------- - -Thank you for registering. -We require that you "validate" your registration to ensure that -the email address you entered was correct. This protects against -unwanted spam and malicious abuse. - -To activate your account, simply click on the following link: - -<#THE_LINK#> - -(AOL Email users may need to cut and paste the link into your web -browser). - ------------------------------------------------- - HELP, I GOT AN ERROR! ------------------------------------------------- - -If you could not validate your registration by clicking on the link, please -visit this page: - -<#MAN_LINK#> - -It will ask you for a user id number, and your validation key. These are shown -below: - -User ID: <#ID#> - -Validation Key: <#CODE#> - -Please cut and paste, or type those numbers into the corresponding fields in the form. - -If you still cannot validate your account, it's possible that the account has been removed. -If this is the case, please contact an administrator to rectify the problem. - -Thank you for registering and enjoy your stay! - -EOF; - -$EMAIL['admin_newuser'] = << completed their registraton on <#DATE#> - -You can turn off user notification in the Admin Control Panel - -Have a super day! - -EOF; - -$EMAIL['lost_pass'] = <<, -This email has been sent from <#BOARD_ADDRESS#>. - -You have received this email because a password recovery -was instigated. - -IMPORTANT! IF YOU DID NOT REQUEST A PASSWORD RECOVERY DO -NOT GO ANY FURTHER AND DELETE THIS EMAIL! - -ONLY FOLLOW THE INSTRUCTIONS BELOW IF -YOU WISH FOR YOUR PASSWORD TO BE RESET! - ------------------------------------------------- - ACTIVATION INSTRUCTIONS BELOW ------------------------------------------------- - -We require that you "validate" your password recovery to ensure that -you instigated this action. This protects against -unwanted spam and malicious abuse. - -If you do not have the form show in your browser window, simply click on the following link: - -<#MAN_LINK#> - -(AOL Email users may need to cut and paste the link into your web -browser). - -It will ask you for a user id number, and your validation key. These are shown -below: - -User ID: <#ID#> - -Validation Key: <#CODE#> - -Please cut and paste, or type those numbers into the corresponding fields in the form. - -Once the activation is complete, you will be able to log in using your new password (shown below). You can -change this password at any time from your personal control panel. - ------------------------------------------------- - YOUR NEW PASSWORD ------------------------------------------------- - -Your new password is: <#PASSWORD#> - -Keep this password safe. Remember, you will need to re-activate your account -before you can use this password. - ------------------------------------------------- - HELP, I GOT AN ERROR! ------------------------------------------------- - -If you cannot re-activate your account, it's possible that the account has been removed or you -are in the process of another activation, such as registering or changing your registered email address. -If this is the case, then please complete the previous activation. -If the error persists, please contact an administrator to rectify the problem. - - -EOF; - -$EMAIL['newemail'] = <<, -This email has been sent from <#BOARD_ADDRESS#>. - -You have received this email because you requested an -email address change. - ------------------------------------------------- - ACTIVATION INSTRUCTIONS BELOW ------------------------------------------------- - -We require that you "validate" your email address change to ensure that -you instigated this action. This protects against -unwanted spam and malicious abuse. - -If you do not have the form show in your browser window, simply click on the following link: - -<#MAN_LINK#> - -(AOL Email users may need to cut and paste the link into your web -browser). - -It will ask you for a user id number, and your validation key. These are shown -below: - -User ID: <#ID#> - -Validation Key: <#CODE#> - -Please cut and paste, or type those numbers into the corresponding fields in the form. - -Once the activation is complete, you will need to log back in to update your member group -permissions. - ------------------------------------------------- - HELP, I GOT AN ERROR! ------------------------------------------------- - -If you cannot re-activate your account, it's possible that the account has been removed or you -are in the process of another activation, such as registering or changing your registered email address. -If this is the case, then please complete the previous activation. -If the error persists, please contact an administrator to rectify the problem. - - -EOF; - -$EMAIL['forward_page'] = << - - -<#THE_MESSAGE#> - ---------------------------------------------------- -Please note that IBForums has no control over the -contents of this message. ---------------------------------------------------- - -EOF; - - - -$EMAIL['subs_with_post'] = <<, - -<#POSTER#> has just posted a reply to a topic that you have subscribed to titled "<#TITLE#>". - ----------------------------------------------------------------------- -<#POST#> ----------------------------------------------------------------------- - -The topic can be found here: -<#BOARD_ADDRESS#>?act=ST&f=<#FORUM_ID#>&t=<#TOPIC_ID#> - - - -There may be more replies to this topic, but only 1 email is sent per day for each subscribed topic. This is -to limit the amount of mail that is sent to your inbox. - -Unsubscribing: --------------- - -You can unsubscribe at any time by logging into your control panel and clicking on the "View Subscriptions" link. - -EOF; - - -$EMAIL['subs_no_post'] = <<, - -<#POSTER#> has just posted a reply to a topic that you have subscribed to titled "<#TITLE#>". - -The topic can be found here: -<#BOARD_ADDRESS#>?act=ST&f=<#FORUM_ID#>&t=<#TOPIC_ID#> - -There may be more replies to this topic, but only 1 email is sent per day for each subscribed topic. This is -to limit the amount of mail that is sent to your inbox. - -Unsubscribing: --------------- - -You can unsubscribe at any time by logging into your control panel and clicking on the "View Subscriptions" link. - -EOF; - - - -$EMAIL['email_member'] = <<, - -<#FROM_NAME#> has sent you this email from <#BOARD_ADDRESS#>. - - -<#MESSAGE#> - ---------------------------------------------------- -Please note that IBForums has no control over the -contents of this message. ---------------------------------------------------- - - -EOF; - -$EMAIL['complete_reg'] = <<. You may now log in with -your chosen details and access your full user account at <#BOARD_ADDRESS#> - -EOF; - - + team. +<#BOARD_ADDRESS#> + +EOF; + + +$EMAIL['pm_notify'] = <<, + +<#POSTER#> has sent you a new private message entitled "<#TITLE#>". + +You can read this private message by following the link below: + +<#BOARD_ADDRESS#><#LINK#> + + +EOF; + + + +$EMAIL['send_text'] = << + +From, + +<#USER NAME#> + +EOF; + + +$EMAIL['report_post'] = <<, + +You have been sent this email from <#USERNAME#> via the "Report this post to a moderator" link. + +------------------------------------------------ +Topic: <#TOPIC#> +------------------------------------------------ +Link to post: <#LINK_TO_POST#> +------------------------------------------------ +Report: + +<#REPORT#> + +------------------------------------------------ + +EOF; + + + +$EMAIL['pm_archive'] = <<, +This email has been sent from <#BOARD_ADDRESS#>. + +Your archived messages have been compiled into a single +file and has been attached to this message. + +EOF; + +$EMAIL['reg_validate'] = <<, +This email has been sent from <#BOARD_ADDRESS#>. + +You have received this email because this email address +was used during registration for our forums. +If you did not register at our forums, please disregard this +email. You do not need to unsubscribe or take any further action. + +------------------------------------------------ +Activation Instructions +------------------------------------------------ + +Thank you for registering. +We require that you "validate" your registration to ensure that +the email address you entered was correct. This protects against +unwanted spam and malicious abuse. + +To activate your account, simply click on the following link: + +<#THE_LINK#> + +(AOL Email users may need to cut and paste the link into your web +browser). + +------------------------------------------------ +Not working? +------------------------------------------------ + +If you could not validate your registration by clicking on the link, please +visit this page: + +<#MAN_LINK#> + +It will ask you for a user id number, and your validation key. These are shown +below: + +User ID: <#ID#> + +Validation Key: <#CODE#> + +Please cut and paste, or type those numbers into the corresponding fields in the form. + +If you still cannot validate your account, it's possible that the account has been removed. +If this is the case, please contact an administrator to rectify the problem. + +Thank you for registering and enjoy your stay! + +EOF; + +$EMAIL['admin_newuser'] = << completed their registraton on <#DATE#> + +You can turn off user notification in the Admin Control Panel + +Have a super day! + +EOF; + +$EMAIL['lost_pass'] = <<, +This email has been sent from <#BOARD_ADDRESS#>. + +You have received this email because a user account password recovery +was instigated by you on <#BOARD_NAME#>. + +------------------------------------------------ +IMPORTANT! +------------------------------------------------ + +If you did not request this password change, please IGNORE and DELETE this +email immediately. Only continue if you wish your password to be reset! + +------------------------------------------------ +Activation Instructions Below +------------------------------------------------ + +We require that you "validate" your password recovery to ensure that +you instigated this action. This protects against +unwanted spam and malicious abuse. + +If you do not have the form show in your browser window, simply click on the following link: + +<#MAN_LINK#> + +(AOL Email users may need to cut and paste the link into your web +browser). + +It will ask you for a user id number, and your validation key. These are shown +below: + +User ID: <#ID#> + +Validation Key: <#CODE#> + +Please cut and paste, or type those numbers into the corresponding fields in the form. + +Once the activation is complete, you will be able to log in using your new password (shown below). You can +change this password at any time from your personal control panel. + +------------------------------------------------ +Your New Password +------------------------------------------------ + +Your new password is: <#PASSWORD#> + +Keep this password safe. Remember, you will need to re-activate your account +before you can use this password. + +------------------------------------------------ +Is this not working? +------------------------------------------------ + +If you cannot re-activate your account, it's possible that the account has been removed or you +are in the process of another activation, such as registering or changing your registered email address. +If this is the case, then please complete the previous activation. +If the error persists, please contact an administrator to rectify the problem. + +IP address of sender: <#IP_ADDRESS#> + + +EOF; + +$EMAIL['newemail'] = <<, +This email has been sent from <#BOARD_ADDRESS#>. + +You have received this email because you requested an +email address change. + +------------------------------------------------ + ACTIVATION INSTRUCTIONS BELOW +------------------------------------------------ + +We require that you "validate" your email address change to ensure that +you instigated this action. This protects against +unwanted spam and malicious abuse. + +If you do not have the form show in your browser window, simply click on the following link: + +<#MAN_LINK#> + +(AOL Email users may need to cut and paste the link into your web +browser). + +It will ask you for a user id number, and your validation key. These are shown +below: + +User ID: <#ID#> + +Validation Key: <#CODE#> + +Please cut and paste, or type those numbers into the corresponding fields in the form. + +Once the activation is complete, you will need to log back in to update your member group +permissions. + +------------------------------------------------ + HELP, I GOT AN ERROR! +------------------------------------------------ + +If you cannot re-activate your account, it's possible that the account has been removed or you +are in the process of another activation, such as registering or changing your registered email address. +If this is the case, then please complete the previous activation. +If the error persists, please contact an administrator to rectify the problem. + + +EOF; + +$EMAIL['forward_page'] = << + + +<#THE_MESSAGE#> + +--------------------------------------------------- +Please note that IBForums has no control over the +contents of this message. +--------------------------------------------------- + +EOF; + + + +$EMAIL['subs_with_post'] = <<, + +<#POSTER#> has just posted a reply to a topic that you have subscribed to titled "<#TITLE#>". + +---------------------------------------------------------------------- +<#POST#> +---------------------------------------------------------------------- + +The topic can be found here: +<#BOARD_ADDRESS#>?act=ST&f=<#FORUM_ID#>&t=<#TOPIC_ID#> + + + +There may be more replies to this topic, but only 1 email is sent per board visit for each subscribed topic. This is +to limit the amount of mail that is sent to your inbox. + +Unsubscribing: +-------------- + +You can unsubscribe at any time by logging into your control panel and clicking on the "View Subscriptions" link. + +EOF; + + +$EMAIL['subs_new_topic'] = <<, + +<#POSTER#> has just posted a new topic entitled "<#TITLE#>" in forum "<#FORUM#>". + +The topic can be found here: +<#BOARD_ADDRESS#>?act=ST&f=<#FORUM_ID#>&t=<#TOPIC_ID#> + +Please note that if you wish to get email notification of any replies to this topic, you will have to click on the +"Track this Topic" link shown on the topic page, or by visiting the link below: +<#BOARD_ADDRESS#>?act=Track&f=<#FORUM_ID#>&t=<#TOPIC_ID#> + + +Unsubscribing: +-------------- + +You can unsubscribe at any time by logging into your control panel and clicking on the "View Subscriptions" link. + +EOF; + + +$EMAIL['subs_no_post'] = <<, + +<#POSTER#> has just posted a reply to a topic that you have subscribed to titled "<#TITLE#>". + +The topic can be found here: +<#BOARD_ADDRESS#>?act=ST&f=<#FORUM_ID#>&t=<#TOPIC_ID#> + +There may be more replies to this topic, but only 1 email is sent per board visit for each subscribed topic. This is +to limit the amount of mail that is sent to your inbox. + +Unsubscribing: +-------------- + +You can unsubscribe at any time by logging into your control panel and clicking on the "View Subscriptions" link. + +EOF; + + + +$EMAIL['email_member'] = <<, + +<#FROM_NAME#> has sent you this email from <#BOARD_ADDRESS#>. + + +<#MESSAGE#> + +--------------------------------------------------- +Please note that IBForums has no control over the +contents of this message. +--------------------------------------------------- + + +EOF; + +$EMAIL['complete_reg'] = <<. You may now log in with +your chosen details and access your full user account at <#BOARD_ADDRESS#> + +EOF; + + ?> \ No newline at end of file diff --git a/upload/lang/en/lang_boards.php b/upload/lang/en/lang_boards.php index e391c0df..dcc8f4fd 100644 --- a/upload/lang/en/lang_boards.php +++ b/upload/lang/en/lang_boards.php @@ -2,11 +2,19 @@ $lang = array ( +'qli_title' => "Quick Log In", +'qli_name' => "User Name", +'qli_go' => "Go", + by => "By", +'calender_f_title' => "Forthcoming Calendar Events within the next %s days", + +'no_calendar_events' => "There are no forthcoming calendar events", + 'newslink' => "latest news: ", -'welcome_back_text' => "Welcome back, your last visit was on", +'welcome_back_text' => "Welcome back; your last visit was on", 'sm_today_posters' => "Today's top 10 posters", 'sm_all_posters' => "Overall top 10 posters", @@ -19,7 +27,7 @@ total_forums => "Total Forums:", public_forums => "Public Forums", public_members => "members", -'total_word_string' => "Our members have made a total of <#posts#> posts
    We have <#reg#> registered members
    The newest member is <#mem#>", +'total_word_string' => "Our members have made a total of <#posts#> posts
    We have <#reg#> registered members
    The newest member is <#mem#>", 'birthday_header' => "Today's Birthdays", @@ -57,7 +65,7 @@ forum_icons => "Forum Icons", info => "Information", -active_users => "user(s) active in the past 15 minutes", +active_users => "user(s) active in the past %s minutes", f_none => "----", most_online => "Most users ever online was <#NUM#> on <#DATE#>", diff --git a/upload/lang/en/lang_buddy.php b/upload/lang/en/lang_buddy.php new file mode 100644 index 00000000..a37350c7 --- /dev/null +++ b/upload/lang/en/lang_buddy.php @@ -0,0 +1,43 @@ + "My Assistant", +'log_in_needed' => "Log in required", +'no_guests' => "This feature is for registered members only.

    If you are a registered member, please log in.", +'log_in' => "Log In", +'lin_name' => "Username", +'lin_pass' => "PassWord", + +'reg_text' => "If you are not a registered member you will need to register an account before you can use this feature.", + + +'reg_link' => "Register a new account", + +'close_win' => "Close Window", +'refresh' => "Refresh", + +'show_me' => "Show me...", + +'sm_today_posters' => "Today's top 10 posters", +'sm_all_posters' => "Overall top 10 posters", +'sm_forum_leaders' => "The moderating team", +'sm_todays_posts' => "Today's active topics", +'sm_my_last_posts' => "My last 10 posts", + +'while_away' => "Since your last visit...", +'no_new_posts' => "There have been no new posts", + +'new_posts' => "There are %s new posts.", +'view_link' => "View", +'my_replies' => "%s of these posts are replies to topics you started.", +'none' => "none", +'search_forums' => "Search posts for...", +'search_help' => "Search help for...", +'go' => "Go!", + + + +); + +?> \ No newline at end of file diff --git a/upload/lang/en/lang_calendar.php b/upload/lang/en/lang_calendar.php new file mode 100644 index 00000000..6bcdcd39 --- /dev/null +++ b/upload/lang/en/lang_calendar.php @@ -0,0 +1,38 @@ + 'Calendar', +'table_title' => 'Forums Event Calendar', + +'form_submit_show' => "Show", + +'entry_birthdays' => "%s Birthday(s)", + +'post_new_event' => "Post New Event", + +'new_event_redirect' => "your calendar event has been posted", + +'cal_title_events' => "Calendar Events", + +'cal_birthdays' => "Birthdays", + +'back' => "Back", + +'private_event' => "Private Event", +'public_event' => "Public Event", +'restricted_event' => "Restricted Event", + +'joined' => "Joined:", +'posts' => "Posts:", +'group' => "Group:", + +'edit_event' => "Edit Event:", + +'edit_event_redirect' => "the calendar event has been edited", +'delete_event_redirect' => "the calendar event has been deleted", + +'event_date' => "Event Date:", + +); +?> \ No newline at end of file diff --git a/upload/lang/en/lang_emails.php b/upload/lang/en/lang_emails.php index 2917e5e8..b1415308 100644 --- a/upload/lang/en/lang_emails.php +++ b/upload/lang/en/lang_emails.php @@ -2,6 +2,26 @@ $lang = array ( +'msn_send_msg' => "Send this member an MSN Message", +'msn_add_contact' => "Add this member to your MSN buddy list", + +'msn_name' => "Members MSN Name", + + +'yahoo_send_msg' => "Send this member a Yahoo! Message", +'yahoo_view_profile' => "View this members Yahoo! Profile", +'yahoo_status' => "Yahoo! Online Status", +'yahoo_name' => "Members Yahoo! Name", + +'report_title' => "Report this post to a moderator", +'report_submit' => "Submit Report", +'report_message' => "Enter your report

    Please note: The moderator will be made aware of the link to the post and the topic title.

    This form is to be used ONLY for reporting objectional content, etc and is not to be used as a method of communicating with moderators for other reasons.", +'report_topic' => "Topic Title", + + +'report_subject' => "Reported Post from", + +'report_redirect' => "the report has been submitted, returning you to the topic", message => "Message", diff --git a/upload/lang/en/lang_error.php b/upload/lang/en/lang_error.php index 0afa234e..bbb671af 100644 --- a/upload/lang/en/lang_error.php +++ b/upload/lang/en/lang_error.php @@ -2,6 +2,37 @@ $lang = array ( + +'me_no_forum' => "You don't appear to have any forums to moderate.", + + +'search_word_short' => "One or all of your search keywords were below <#EXTRA#> characters, please go back and increase the length of these search keywords.", + +'no_name_search_results' => "The member name you chose to filter by cannot be found, please go back and try again.", + + +'split_not_enough' => "You must choose at least one post to split!", + +'mt_no_topic' => "We could not find a topic in the database that matches the URL you entered, please try again and double check the information entered", +'mt_same_topic' => "You cannot merge the same topic, that's just silly", + +'forum_no_post_allowed' => "You cannot move topics into this forum as it does not allow posts to be made", + + +'no_msn' => "This member does not have a valid MSN Messenger Name.", +'no_yahoo' => "This member does not have a valid Yahoo! Messenger Name", + +'cf_to_long' => "You entered too much data for the field '<#EXTRA#>', please go back and check the input", + + +'search_flood' => "Sorry, the board administrator has enabled search flood control. Please wait at least <#EXTRA#> seconds before trying again.", + +'cal_no_events' => "There are no birthdays or events for that date, please go back and try again.", +'cal_date_oor' => "The date you have chosen for that event is not a legal date (You may have chosen 30th February for example). Please go back and check your input and try again.", + +'cal_title_none' => "You must enter an event title that is longer than 2 characters", +'cal_title_long' => "The event title you entered was too long, please limit it to under 64 characters", + 'search_off' => "Sorry, the administrator has taken the search engine offline for the moment. Please try again later", 'reg_off' => "The board administrator is no longer accepting any new registrations at the moment.", @@ -116,7 +147,7 @@ log_in_now => "Log in Now!", no_subject => "You did not enter a subject for the email", pass_too_long => "The password entered was too long", username_short => "The username you entered was too short", -already_sub => "You are already subscribed to this topic", +already_sub => "You are already subscribed to this topic or forum.", forgot_pass => "Forgotten your password?", no_older => "There are no topics older than this one", stf_no_name => "You must enter the name of the person you are sending this page to", @@ -180,7 +211,7 @@ user_agent_no_match => "You are using a different computer than the one you poll_add_vote => "Vote!", you_are_banned => "Sorry, you are not permitted to use this board", incorrect_use => "Incorrect use of one of the IBForums files", -no_search_results => "Sorry, but we did not find any matches", +no_search_results => "Sorry, but we did not find any matches. Try again and broaden your search criteria.", request_error => "An error occured, not all of the required fields were sent from the validation link. Please ensure that they whole link was entered, it's possible that your email clients auto-wrapper cut the link in half. Please try again.", not_yahoo_name => "That is not a valid YAHOO name", stf_invalid_email => "The email address you entered was of an incorrect format", diff --git a/upload/lang/en/lang_forum.php b/upload/lang/en/lang_forum.php index ee0e76a0..c1a87282 100644 --- a/upload/lang/en/lang_forum.php +++ b/upload/lang/en/lang_forum.php @@ -2,6 +2,16 @@ $lang = array ( +'pinned_start' => "Important Topics", +'regular_topics' => "Forum Topics", + +'ft_title' => "Subscribe to this forum", + +'active_users_detail' => "%s Guests and %s Anonymous Users", +'active_users_title' => "%s User(s) are browsing this forum", +'active_users_members' => "%s Members:", + + 'enter_keywords' => "Enter Keywords", 'search_forum' => "Search this forum:", 'search_go' => "Go", @@ -20,7 +30,7 @@ pm_hot_new => "Hot Topic (new replies)", show_25_days => "the last 25 days", mark_as_read => "Mark this forum as read", show_20_days => "the last 20 days", -mod_cp => "Moderators Control Panel", + sort_by_date => "last post date", sort_by_last_poster => "last poster", pm_open_no => "Open Topic (no new replies)", diff --git a/upload/lang/en/lang_global.php b/upload/lang/en/lang_global.php index 25e5be96..c7f1b7a8 100644 --- a/upload/lang/en/lang_global.php +++ b/upload/lang/en/lang_global.php @@ -2,10 +2,29 @@ $lang = array ( + +'mod_cp' => "Mod CP", + +'tb_help' => "Help", +'tb_search' => "Search", +'tb_mlist' => "Members", +'tb_calendar' => "Calendar", + 'gzip_on' => "GZIP Enabled", 'gzip_off' => "GZIP Disabled", +'l_qb' => 'My Assistant', +'view_new_posts' => "View New Posts", +'your_cp' => "My Controls", + + +'bb_tool_tip' => "View posts since your last visit, moderator lists and more...", +'cp_tool_tip' => "Edit my settings, such as signature, avatar and more...", + + +'find_user_names' => "Search for user names", +'opens_new_window' => "( opens in new window )", 'warn_offline' => "(OFFLINE)", @@ -54,33 +73,38 @@ offline_title => "IBForums Offline Mode", you_last_visit => "You last visited on:", code_sample => "Code Sample", transfer_you => "Please wait while we transfer you...", -M_1 => "Jan.", -M_2 => "Feb.", -admin_login => "Administrators Log in", -M_3 => "Mar.", -D_0 => "Sun", new_posts => "New Posts", -M_4 => "April", -D_1 => "Mon", -M_5 => "May", -D_2 => "Tue", -M_6 => "June", +admin_login => "Administrators Log in", you_running_time => "Your last action was on:", -D_3 => "Wed", -M_7 => "July", admin_cp => "Admin CP", -D_4 => "Thur", -M_8 => "Aug.", -D_5 => "Fri", -M_9 => "Sep.", -your_cp => "Your Control Panel", -D_6 => "Sat", + +M_1 => "January", +M_2 => "February", +M_3 => "March", +M_4 => "April", +M_5 => "May", +M_6 => "June", +M_7 => "July", +M_8 => "August", +M_9 => "September", +M_10 => "October", +M_11 => "November", +M_12 => "December", + +D_0 => "Sunday", +D_1 => "Monday", +D_2 => "Tuesday", +D_3 => "Wednesday", +D_4 => "Thursday", +D_5 => "Friday", +D_6 => "Saturday", + + + name => "Name", register => "Register", 'logged_in_as' => "Logged in as: ", -M_10 => "Oct.", -M_11 => "Nov.", -M_12 => "Dec.", + msg_new => "%s new messages", offline => "Sorry, the boards are offline at the moment", log_out => "Log Out", diff --git a/upload/lang/en/lang_legends.php b/upload/lang/en/lang_legends.php index 98951bf8..a664f9f9 100644 --- a/upload/lang/en/lang_legends.php +++ b/upload/lang/en/lang_legends.php @@ -6,5 +6,20 @@ $lang = array ( 'emo_type' => "Code", 'emo_img' => "Image", +'fu_title' => "Find User Names", +'fu_close_win' => "Close Window", +'fu_enter_name' => "Enter part or all of the name", +'fu_search_but' => "Search", + +'fu_error' => "Error", + +'fu_no_data' => "You must enter all or part of a name to search by", +'fu_no_match' => "We found no matches using your search criteria", +'fu_kc_loads' => "We found over 100 matches, please try and enter more of the username", +'fu_back' => "Back", +'fu_add_mem' => "Insert member into form", +'fu_add_desc' => "Please select a name from the drop down box and click on the button to add the name into the form that opened this window", + + ); ?> \ No newline at end of file diff --git a/upload/lang/en/lang_login.php b/upload/lang/en/lang_login.php index 4054dbaf..fba198ea 100644 --- a/upload/lang/en/lang_login.php +++ b/upload/lang/en/lang_login.php @@ -2,6 +2,11 @@ $lang = array ( +'logged_in' => "You are logged in, returning you to the board index", +'reg_log_in' => "You are now registered and logged in, returning you to the board index", +'not_logged_in' => "You are not logged in, taking you to the log in form", +'reg_not_log_in' => "You are now registered, taking you to the log in form", + login_text => "You must already have registered for an account before you can log in.
    If you do not have an account, you may register by clicking the 'register' link near the top of the screen", diff --git a/upload/lang/en/lang_mlist.php b/upload/lang/en/lang_mlist.php index 3054fdab..dc031a93 100644 --- a/upload/lang/en/lang_mlist.php +++ b/upload/lang/en/lang_mlist.php @@ -2,6 +2,11 @@ $lang = array ( +'ch_begins' => "Name begins with", +'ch_contains' => "Name contains", +'ch_all' => "Search All Available", +'qs_go' => "Go!", + member_group => "Group", member_aol => "AOL", sort_by_name => "Member Name", diff --git a/upload/lang/en/lang_mod.php b/upload/lang/en/lang_mod.php index f1918b34..1d23896f 100644 --- a/upload/lang/en/lang_mod.php +++ b/upload/lang/en/lang_mod.php @@ -2,6 +2,48 @@ $lang = array ( +'st_top' => "Split Topic", +'st_explain' => "Splitting a topic allows you to select posts to be moved into a new topic. Please specify the title and description for the new topic and its destination forum before continuing.
    Note Long posts are reverted back to code tags and shortened to prevent long pages", +'st_forum' => "Forum for new topic", +'st_submit' => "Split the selected posts", +'st_post' => "Post Review", +'st_split' => "Move this post", +'st_top_bit' => "Posted by %s on %s", +'st_redirect' => "The topic has been split, returning you to the original forum", + +'th_title' => "Topic History Report", +'th_topic' => "Topic Title", +'th_desc' => "Topic Description", +'th_start_date' => "Topic Started on", +'th_start_name' => "Topic Started by", +'th_last_date' => "Last Post on", +'th_last_name' => "Last Post by", +'th_avg_post' => "Average Posts per day", + +'ml_title' => "Moderator Log Entries", +'ml_name' => "Member Name", +'ml_desc' => "Description", +'ml_date' => "Date", +'ml_none' => "There are no entries for this topic", + + + +'mt_top' => "Merge Topic", +'mt_explain' => "Merging topics allows you to 'move' all the posts from another topic into this one. The new topic will be sorted in chronological order, ensure this is the desired effect before continuing. Polls and poll voter information will not be merged.", +'mt_new_title' => "Topic Title", +'mt_new_desc' => "Topic Description", +'mt_tid' => "Enter in the URL of the topic that you wish to merge with this one.
    (Tip: You can simply copy the URL from your browser address bar when viewing the topic and paste it here)", +'mt_submit' => "Merge Topics", +'mt_redirect' => "The topics have been merged, returning you to the newly merged topic", + + + +'ts_title' => 'Topic Subscriptions', +'ts_count' => 'There are %s members subscribed to this topic, do you wish to unsubscribe them all?', +'ts_submit' => "Unsubscribe all members", +'ts_none' => "There are no members subscribed to this topic. You can still unsubscribe all members, but it won't make any difference", +'ts_redirect' => "all members have been unsubscribed from this topic", + 'cp_redirect_mod_topics' => "Topics/Posts have been approved or deleted - redirecting back to check for more...", 'cp_prune' => "Manage Topics in forum: ", diff --git a/upload/lang/en/lang_modcp.php b/upload/lang/en/lang_modcp.php new file mode 100644 index 00000000..0b98f2d5 --- /dev/null +++ b/upload/lang/en/lang_modcp.php @@ -0,0 +1,181 @@ + "Please ensure that the source and destination forums exist, are able to accept topics (not sub forums only), you have permission to move them into that forum and that the source forum isn't the same as the destination forum", + +'cp_tmove_start' => "Moving topics from forum:", +'cp_tmove_to' => "Select a destination forum", +'cp_tmove_end' => "Move selected topics", + +'cp_js_delete' => "Are you sure you wish to delete these topics?", + +'cp_redirect_topics' => "Topics updated, returning to the topic list", + +'cp_err_no_topics' => "Please ensure that you check at least one box before continuing", + +'new_show_forum' => "Show normal forum view in new window", + +'fv_no_topics' => "There are no topics to display or this forum is unable to receive new topics", + +'cp_redirect_mod_topics' => "Topics/Posts have been approved or deleted - redirecting back to check for more...", + +'cp_prune' => "Manage Topics in forum: ", +'cp_prune_days' => "(Re)move topics with no new posts over [x] days.
    (x = value entered)", +'cp_prune_type' => "(Re)move which type of topic?", +'cp_pday_open' => "Open Topics only", +'cp_pday_closed' => "Locked Topics only", +'cp_pday_link' => "Move linked Topics only", +'cp_pday_all' => "Any type of topic", +'cp_prune_replies' => "..with less than [x] replies
    (Leave this blank to remove topics regardless of replies)", +'cp_prune_member' => "...started by member
    (Leave blank to (re)move regardless of topic starter)", +'cp_prune_sub1' => "Check Form Submission", +'cp_prune_sub2' => "Prune this forum!", +'cp_action' => "Prune Action", +'cp_ac_prune' => "PRUNE ONLY, DON'T MOVE", +'cp_prune_text' => "You may remove topics or move topics to another forum based on your criteria. To move topics, choose a destination forum from the drop down menu. To simply remove the topics, choose 'PRUNE ONLY' from the forums drop down menu. Moving topics will not leave moved links in the source forum", +'cp_pages' => "Page: ", +'cp_error_no_mem' => "We could not locate a member by that name, please try again", +'cp_error_no_topics' => "There are no topics left in the moderation queue in this forum.", +'cp_total_topics' => "Total topics in this forum", +'cp_total_match' => "Total topics to (re)move", +'cp_check_result' => "Form Check Results", +'cp_check_text' => "Continue only if satisfied with the results, clicking the link below WILL carry out the action. If you need to make any changes, please adjust the form below and re-check the submission.", +'cp_mod_topics_title2' => "Moderating New Topics in: ", +'cp_mod_posts_title2' => "Moderating New Posts in: ", +'cp_prune_domove' => "Move the topics!", +'cp_prune_dorem' => "Remove the topics!", +'cp_same_forum' => "You cannot move into the same forum", +'cp_no_forum' => "That is not a valid destination forum", +'cp_3_title' => "Topic Title", +'cp_3_replies' => "Queued Replies", +'cp_3_approveall' => "Approve All", +'cp_3_viewall' => "Manage Queued", +'cp_3_postno' => "Post #", + +'cp_err_no_f' => "No forum was chosen or the forum chosen does not exist, please go back and try again", +'cp_err_no_p' => "You do not have permission to view the topics in this forum", + +'cp_error_no_subforum' => "You cannot choose a sub category as a destination forum", + +'cp_1_approve' => "Approve", +'cp_1_remove' => "Delete", +'cp_1_leave' => "Leave", +'cp_1_selected' => "selected posts", +'cp_1_go' => "Manage these posts", + +'cp_results' => "Result", +'cp_result_move' => "Number of topics moved: ", +'cp_result_del' => "Number of topics deleted: ", + +'cp_edit_user' => "Edit a users profile", +'cp_find_user' => "Enter part, or all of the username you wish to edit", +'cp_find_submit' => "Find user", +'cp_find_2_user' => "Please select a member from the matches", +'cp_find_2_submit' => "Edit users profile", +'cp_no_matches' => "There was no data returned from your search input, please try again", +'cp_admin_user' => "You cannot edit an administrators profile from this control panel", +'cp_no_perms' => "You do not have permission for this action.", + +'cp_remove_av' => "Remove users avatar?", +'cp_edit_website' => "Website", +'cp_edit_location' => "Location", +'cp_edit_signature' => "Signature", +'cp_edit_interests' => "Interests", + + + +'cp_mod_in' => "Current Forum", +'cp_topics_wait' => "Topics Pending Moderation", +'cp_posts_wait' => "Posts Pending Moderation", + +'cp_modcp_ptitle' => "Moderators Control Panel", + +'cp_modcp_home' => "Moderators CP Home", + +'cp_error' => "Control Panel Message", +'cp_welcome' => "Welcome!", +'cp_welcome_text' => "Welcome to your moderators control panel.
    From here you will be able to process moderated topics and posts, mass move topics and prune posts. Simply choose an option from the left menu bar to proceed.", + + +'cp_mod_topics' => "Moderate New Topic Queue", +'cp_mod_posts' => "Moderate New Post Queue", + +'cpt_close' => "Close Topics", +'cpt_open' => "Open Topics", +'cpt_pin' => "Pin Topics", +'cpt_unpin' => "Unpin Topics", +'cpt_move' => "Move Topics", +'cpt_delete' => "Delete Topics", + + +'cp_prune_posts' => "Mass Move /Prune Topics", + + +'cp_user_edit' => "Edit Users Profile", + +'title_manage_forums' => "Manage Your Forums", + +'f_q_posts' => "Queued Posts", +'f_q_topics' => "Queued Topics", +'f_select' => "Select", + +'f_w_selected' => "With selected forum:", +'t_w_selected' => "With selected topics:", +'f_go' => "Go!", + +'menu_forums' => "Manage Your Forums", +'menu_users' => "Manage Members", +'menu_ip' => "IP Address Tools", + +'mod_opts' => "Moderation Options", + +'ip_desc_text' => "The following options are available to you

    Resolve IP Address: This option will allow you to look up an IP address for more information (note, you must enter all 4 parts of the IP address to use this tool)
    Find Posts with this IP: This option will run a search for all posts associated with this IP address
    Find members who registered with this IP: This tool will run a seach for all members who registered with the entered IP address", +'ip_warn_text' => "Please Note: You may enter a wildcard '*' (without quotes) as the last part of the IP address.
    For example, 127.*.*.* will match all IP address that start with 127.
    127.1.0.* will match all IP addresses that start with 127.1.0.
    An error will occur if you attempt to use a wildcard in the middle of the IP address. For example, 127.*.0.1 will return an error.", +'ip_enter' => "Enter the IP address
    (Hint, hitting tab in most browsers will take you to the next box)", +'ip_submit' => "Run Tool", + +'ip_resolve' => "Resolve", +'ip_posts' => "Find Posts", +'ip_members' => "Find Members", + +'cp_error_ip' => "Please ensure that at least the first two IP address fields are completed and that the wildcard '*' is not in the middle of the IP address", +'cp_error_resolveip' => "You must enter the complete IP address to use this tool", +'ip_resolve_result' => "The host name for %s is %s

    Try visiting nic.com to get more information by running this match via WHOIS.", + +'cp_safe_fail' => "This operation failed or no data was returned. If you are running PHP in safe mode, you may not be able to use all the tools provided", + +'cp_no_matches' => "No matching results were found, please go back and review the search criteria", + +'ipm_title' => "IP Address Member Search Results", +'ipm_name' => "Name", +'ipm_ip' => "IP Address", +'ipm_posts' => "Posts", +'ipm_reg' => "Date Registered", +'ipm_options' => "Options", + +'ipm_edit' => "Edit Member", +'ipm_view' => "View Profile", + +'ipp_found' => "Your search returned the following number of matching posts:", +'ipp_click' => "Click here to view the results in a new window", + + + + + + + +'leave_link' => "Leave a link to the new topic in the source forum?", + +'yes' => "Yes", +'no' => "No", + +'move_exp' => "Please select the destination forum and method of moving", + + + + + +); +?> \ No newline at end of file diff --git a/upload/lang/en/lang_msg.php b/upload/lang/en/lang_msg.php index 5677a861..99a59edc 100644 --- a/upload/lang/en/lang_msg.php +++ b/upload/lang/en/lang_msg.php @@ -2,12 +2,63 @@ $lang = array ( +'pm_email_subject' => "New Private Message", + +'tk_read_messages' => "Read Messages", +'tk_read_desc' => "The messages shown here have been read by the person they were sent to.", +'tk_read_date' => "Date Read", +'tk_unread_date' => "Date Sent", +'tk_untrack_button' => "End tracking with", + +'tk_unread_messages' => "Unread Messages", +'tk_unread_desc' => "The messages shown here have not been read by the person they were sent to. You may delete them before they are read.", + +'add_to_book' => "Add to Buddies", +'vm_delete_pm' => "Delete PM", +'vm_forward_pm' => "Forward PM", +'vm_track_msg' => "Track this message?", + +'vm_forward_text' => "Message Forwarded From %s", + +'inbox_no_msg' => "No messages found", + +'pm_reply_link' => "Reply", + + +'pmpc_full_string' => "Your folders are <#PERCENT#>% full", +'pmpc_info_string' => "You have %s messages out of %s maximum storable messages", +'pmpc_unlimited' => "an unlimited amount of", + +'pmpc_mark_read' => "Select read messages", +'pmpc_unmark_all' => "Unselect all", + +'pme_title' => "ERROR", +'pme_none_sent' => "This private message has not been sent", +'pms_send_later' => "Save (Send later)", +'pms_redirect' => "this message has been stored for later completion and has not been sent", + +'pms_saved_title' => "Saved Unsent Messages", +'pms_message_to' => "Message For", +'pms_cc_users' => "CC Users?", +'pms_saved_date' => "Saved Date", + +'pme_no_cc_user' => "We could not find any matches for the member names you entered into the carbon copy box, please check the input before resubmitting", +'pme_too_many' => "You are not permitted to carbon copy this message to that many people, please reduce the list and try again", + +'pme_failed_nopm' => "Private Message to %s will fail because %s is not allowed to use the messanger", +'pme_failed_maxed' => "Private Message to %s will fail because %s has reached the maximum allowed stored messages", +'pme_failed_nomem' => "Private Message to %s will fail because %s does not exist!", +'pme_failed_block' => "Private Message to %s will fail because %s has blocked incoming messages", + + 'pm_preview' => "Preview", 'pm_pre_button' => "Preview Message", 'pmp_title' => "You have a new private message!", +'pmp_get_last' => "Read this message in this window", + 'pmp_string' => "Your newest message is from <#NAME#>, entitled '<#TITLE#>'
    This was sent on <#DATE#>", 'pmp_go_inbox' => "Take me to my inbox", @@ -16,6 +67,9 @@ $lang = array ( 'pmp_thiswindow' => "Open in this window", +'carbon_copy_title' => "Carbon copy to other members", +'carbon_copy_desc' => "You may enter up to %s names in the carbon copy box.

    One line per name.", + 'forum_jump' => "Forum Jump", @@ -58,7 +112,7 @@ message_date => "Date", enter_a_name => "Members name", to_whom => "Recipients Name", prefs => "Preferences", -read_rec_notify => "Get notified when this message is read", + prefs_help => "You may set up your messenger preferences from here.", auto_sent_add => "Add a copy of this message to my sent items folder", sort_by => "Sort Messages by", @@ -74,7 +128,7 @@ member_name => "Member Name", viewing_message => "Viewing Message:", submit_send => "Send Message", delete => "Delete", -add_to_book => "Add to contacts", + send_header => " you can choose from the list of stored names from your address book, or enter the name of the member you wish to message", yes => "Yes", goto_folder => "Jump to folder", @@ -101,13 +155,12 @@ address_title => "Your Address Book", no_msg_chosen => "You did not select any messages. You select them by clicking on the checkbox on the far right of each entry", from_name => "Member", new_message => "New Message Status", -inbox_no_msg => "This folder is currently empty", + address_current => "Members already in your list", your_options => "Your Options", send_title => "Send a new message", posted => "Posted", msg_title => "Message Title", -quick_help => "A brief overview of you messenger", submit_address => "Add this member to my address book", icon_read => "Read messages", cannot_remove => "Cannot Remove", @@ -130,13 +183,11 @@ edit => "Edit", enter_block => "Options", prefs_text_b => "You may add extra directories. You do not have to use all the input boxes.", icon_unread => "Unread messages", -sort_submit => "Sort Messages!", splash => "Summary", current_sort => "Messages are currently sorted by: ", member_edit => "You may edit this address book entry.", contact => "Address Book", message_options => "Options", -send_help => "This is where you can send private messages to other members from.", no_reply => "You haven't replied to this message", c_msg_total => "You have <#NUM#> total messages in all your folders.", read_rec_text => "Original message sent on:", diff --git a/upload/lang/en/lang_online.php b/upload/lang/en/lang_online.php index d4afd403..4b0691bc 100644 --- a/upload/lang/en/lang_online.php +++ b/upload/lang/en/lang_online.php @@ -4,7 +4,7 @@ $lang = array ( WHERE_SF => "Viewing Forum:", WHERE_SR => "Viewing Forum Rules:", -WHERE_ST => "Viewing a topic in:", +WHERE_ST => "Viewing Topic:", WHERE_Login => "Logging in...", WHERE_Post => "Posting in forum:", WHERE_Reg => "Registering...", diff --git a/upload/lang/en/lang_post.php b/upload/lang/en/lang_post.php index 2f5f34bf..1ab5607d 100644 --- a/upload/lang/en/lang_post.php +++ b/upload/lang/en/lang_post.php @@ -2,15 +2,65 @@ $lang = array ( -ibf_code_txt => "Roll your mouse over the button for more information.
    Hitting 'ALT' and 'c' closes current tag", + +'poll_question' => "Poll Question", +'poll_tag_allowed' => "[URL] and [IMG] tags allowed", + +'eu_keep' => "Keep current attachment", +'eu_delete' => "Remove attachment", +'eu_new' => "Replace with a new attachment", + +'append_edit' => "Add the 'Edit by' line in this post?", +'edit_ops' => "Edit Options", + +'js_close_all_tags' => "Close all Tags", +'js_tag_list' => "Enter a list item. Click 'cancel' or leave blank to end the list", + +'bbcode_guided' => "Guided Mode", +'bbcode_normal' => "Normal Mode", + +'hb_start' => "Hint: Use Guided Mode for helpful prompts", + +'hb_bold' => "Insert Bold Text (alt + b)", +'hb_italic' => "Insert Italic Text (alt + i)", +'hb_under' => "Insert Underlined Text (alt + u)", +'hb_font' => "Insert Font Face tags", +'hb_size' => "Insert Font Size tags", +'hb_color' => "Insert Font Color tags", +'hb_close' => "Close all open tags", +'hb_url' => "Insert Hyperlink (alt+ h)", +'hb_img' => "Image (alt + g) [img]http://www.dom.com/img.gif[/img]", +'hb_email' => "Insert Email Address (alt + e)", +'hb_quote' => "Insert Quoted Text (alt + q)", +'hb_code' => "Insert Monotype Text (alt + p)", +'hb_list' => "Create a list (alt + l)", +'hb_click_close' => "Click button again to close", + +'hb_open_tags' => "Open Tags", + + +'js_text_to_format' => "Enter the text to be formatted", + +'calendar_title' => "Event Title", +'calendar_event_date' => "Date for Event", +'calendar_event_type' => "Type of Event", +'calendar_type_private' => "Personal Event (Viewable by you only)", +'calendar_type_public' => "Public Event (Viewable by all)", +'calendar_submit' => "Add Calendar Event", +'calendar_group_filter' => "Admin Option (only applies to public events)
    Click on which groups can see this event (Admin group always selected), or leave alone so all groups can see this event.
    Multiple group selection allowed", + +'calendar_edit_submit' => "Edit Event", + +'calendar_delete_box' => "Delete Event? Check this box and submit the form to delete this event.", 'unreg_namestuff' => "Unregistered User Info", mod_options => "After posting...", mod_close => "Close this topic", +'mod_move' => "Move this topic", mod_pin => "Pin this topic", -mod_nowt => "Don't pin or close", +mod_nowt => "( Do Nothing )", 'msg_no_title' => "You must enter a message title", @@ -19,6 +69,7 @@ mod_nowt => "Don't pin or close", 'tt_poll_settings' => "Poll Settings", 'tt_subject' => "Topic Subscription Reply Notification", +'ft_subject' => "Forum Subscription New Topic Notification", 'upload_failed' => "The requested file upload failed. This is either because it was not in the correct format, or the file size was larger than that allowed. Please check the file you wish to upload and try again.", diff --git a/upload/lang/en/lang_printpage.php b/upload/lang/en/lang_printpage.php index 20bde5a0..74f62dfa 100644 --- a/upload/lang/en/lang_printpage.php +++ b/upload/lang/en/lang_printpage.php @@ -2,12 +2,21 @@ $lang = array ( -end => "end", -forum => "Forum", -on => "on", -title => "Printable Version of Topic", -by => "Posted by", -start => "started by", -topic => "Topic", +'end' => "end", +'forum' => "Forum", +'on ' => "on", +'title' => "Printable Version of Topic", +'by' => "Posted by", +'start' => "started by", +'topic' => "Topic", +'tvo_title' => "Topic View Options for:", +'o_print_title' => "Printer Friendly Version", +'o_print_desc' => "This will display the topic in a simple, printer friendly format on this page, no download is required.", +'o_html_title' => "Download HTML Version", +'o_html_desc' => "This will enable you to download a HTML version of this topic to your hard drive. This will open your browser's download dialogue box", +'o_word_title' => "Download Microsoft Word Version", +'o_word_desc' => "This will enable you to download a version of this topic in an editable Word format. This will open your browser's download dialogue box", +'back_topic' => "Back to the topic", +'topic_here' => "Click here to view this topic in its original format", ); ?> \ No newline at end of file diff --git a/upload/lang/en/lang_register.php b/upload/lang/en/lang_register.php index 116d5f65..b8c5553a 100644 --- a/upload/lang/en/lang_register.php +++ b/upload/lang/en/lang_register.php @@ -2,6 +2,58 @@ $lang = array ( +'errors_found' => "The Following Errors Were Found", +'err_email_address_match' => "The email addresses entered did not match", +'err_no_username' => "You must enter a valid username between 3 and 32 characters", +'err_no_password' => "You must enter a valid password between 3 and 32 characters", +'err_pass_match' => "The entered passwords did not match each other, please check the entered values", +'err_invalid_email' => "The email address entered was not a valid email address", +'err_user_exists' => "An account is already registered with that username, please choose another", +'err_email_exists' => "An account is already registered with that email address, please choose another", +'err_reg_code' => "The registration code did not match the one displayed, a new code has been generated, please try again", + + + +'ras_title' => "Registration Anti SPAM Confirmation", +'ras_numbers' => "Your unique registration code
    If you do not see any numbers, or see broken images, please contact a board administrator to rectify the problem.", +'ras_text' => "Confirm registration code
    To prevent mass registration programs from registering accounts, please enter the 6 digit code shown above in image format.
    Note: Only numbers are allowed, a '0' is a numerical zero, not the alphabetical 'O'.", + + + + +'coppa_title' => "COPPA Registration", +'coppa_info' => "COPPA Information", +'coppa_form' => "COPPA Form", + +'coppa_link' => "Please click the link that corresponds with your birth date", +'coppa_date_before' => "On or before", +'coppa_date_after' => "After", +'coppa_form_text' => "A parent or guardian must complete and mail or fax a signed <#FORM_LINK#> to the administratior of the board before a child under the age of 13 can complete the registration process.

    For further information, please contact:", +'coppa_link_form' => "permission form", + +'cp2_text' => " All users under the age of 13 must seek permission from a parent of guardian before you may participate on these forums.

    If you would like to start the registration process prior to us receiving a permission form, please click the continue link below. However, please note that you will not be able to complete your registration until we have the signed form.", +'cp2_continue' => "Continue", +'cp2_title' => "Our COPPA registration policy", +'cp2_cancel' => "Cancel", + +'cp_success' => "your registration was successful! Redirecting you to the consent form", + +'cpf_title' => "COPPA Permission Form", +'cpf_perm_parent' => "Instructions for a parent or guardian

    Please print this form out, complete it and fax it to the number specified (if present) or mail to the mailing address below.", +'cpf_fax' => "Fax Number:", +'cpf_address' => "Mailing Address:", + +'cpf_sign' => "Please sign the form below and send to us.

    I understand that the information that the child has supplied is correct. I understand that the profile information may be changed by entering a password and I understand that I may ask for this registration profile to be removed.", + +'cpf_name' => "Parent / Legal Guardian FULL name", +'cpf_relation' => "Relation to child", +'cpf_signature' => "Signature", +'cpf_email' => "Email Address", +'cpf_phone' => "Phone Number", +'cpf_date' => "Date", + +'cf_optional' => "Optional Information", + 'lost_pass_form' => "Lost Password Form", 'lp_header' => "How to reset your password", diff --git a/upload/lang/en/lang_search.php b/upload/lang/en/lang_search.php index c5b11544..0d5481e5 100644 --- a/upload/lang/en/lang_search.php +++ b/upload/lang/en/lang_search.php @@ -2,14 +2,31 @@ $lang = array ( +'rp_topic' => "Topic:", +'rp_post' => "Post Preview:", +'rp_forum' => "Forum:", +'rp_author' => "Author", +'rp_replies' => "Replies:", +'rp_hits' => "Views:", +'rp_message' => "Message", +'rp_postedon' => "Posted on:", + +'joinname_true' => "Search With Keywords and Username", +'joinname_false' => "Search With Username alone", + +'nav_since_lv' => "Posts since your last visit", +'nav_lt' => "Your last ten posts", + +'results_post' => "Show results as posts", +'results_topics' => "Show results as topics", 'search_redirect' => "your search has been completed, please stand by as we take you to the search results.", 'search_pages' => "Pages:", 'search_title' => "Search Engine", 'key_search' => "Search by Keywords", -'mem_search' => "Search by Member Name", -'keysearch_text' => "Simple Search: Enter a keyword or phrase to search by
    Advanced Search: Join keywords with AND, OR to help define the search.
    Asterisks '*' act as wildcards. (*bar* matches foobarbaz, etc).", +'mem_search' => "Filter by Member Name (optional)", +'keysearch_text' => "Simple Search: Enter a keyword or phrase to search by
    Advanced Search: Join keywords with AND, OR to help define the search.", 'match_name_ex' => "Match Exact Name", 'match_name_pa' => "Match Partial Name", 'keywords_title' => "Search Keywords", diff --git a/upload/lang/en/lang_stats.php b/upload/lang/en/lang_stats.php index 26267869..c12c2288 100644 --- a/upload/lang/en/lang_stats.php +++ b/upload/lang/en/lang_stats.php @@ -2,6 +2,12 @@ $lang = array ( +'who_farted' => "Who posted in:", + +'who_poster' => "Poster", +'who_posts' => "Posts", +'who_go' => "Close window & open topic", + 'todays_posters' => "Todays Top 10 Posters", 'member' => "Member", 'member_posts' => "Total Member Posts", diff --git a/upload/lang/en/lang_topic.php b/upload/lang/en/lang_topic.php index 64e946a0..dd75eeaf 100644 --- a/upload/lang/en/lang_topic.php +++ b/upload/lang/en/lang_topic.php @@ -2,24 +2,40 @@ $lang = array ( +'SPLIT_TOPIC' => "Split Topic", +'MERGE_TOPIC' => "Merge Topic", +'TOPIC_HISTORY' => "View Topic History (Admin Option)", + +'tt_title' => "Track this topic", +'tt_desc' => "Receive email notification when a reply has been made to this topic and you are not active on the board.", + +'ft_title' => "Subscribe to this forum", +'ft_desc' => "Receive email notification when a new topic is posted in this forum and you are not active on the board.", + +'av_title' => "Download / Print this Topic", +'av_desc' => "Download this topic in different formats or view a printer friendly version.", + +'active_users_detail' => "%s Guests and %s Anonymous Users", +'active_users_title' => "%s User(s) are reading this topic", +'active_users_members' => "%s Members:", + 'go_new_post' => "Go to first unread post", -'edited_by' => "Edited by", - +'edited_by' => "This post has been edited by %s on %s", +'UNSUBBIT' => "Unsubscribe all from topic", EDIT_TOPIC => "Edit this Topic", forum_jump => "Forum Jump", UNPIN_TOPIC => "Unpin this Topic", OPEN_TOPIC => "Open this topic", -adjust_level => "Adjust Warn Level", attach_hits => "Number of downloads", DELETE_TOPIC => "Delete this topic", topic_moved => "This topic has moved, taking you to the correct forum", pic_attach => "Attached Image", m_posts => "Posts:", -mod_cp => "Moderators Control Panel", + multi_page_topic => "Pages:", -snitch_geezer_to_a_copper => "Report this post to a moderator", +snitch_geezer_to_a_copper => "Report this post", MOVE_TOPIC => "Move this topic", CLOSE_TOPIC => "Close this topic", topic_page_h => "Topic", @@ -31,7 +47,7 @@ js_del_1 => "Are you sure you want to delete this message?", please_log_in => "You are not logged into this forum.", js_del_2 => "Ok, no action has been taken", start_new_topic => "Start a new topic", -moderation_ops => "Topic Options", +moderation_ops => "Moderation Options", RECOUNT => "Rebuild Topic", ip => "IP", reply_to_topic => "Reply to this topic", diff --git a/upload/lang/en/lang_ucp.php b/upload/lang/en/lang_ucp.php index 10ed07be..6eaf7d2e 100644 --- a/upload/lang/en/lang_ucp.php +++ b/upload/lang/en/lang_ucp.php @@ -2,7 +2,43 @@ $lang = array ( -'dst_box' => "Is daylight savings time in effect?
    (If you have selected the correct time zone and the clock appears an hour out, check or uncheck box to suit)", +'forum_subs_header' => "Your Forum Subscriptions", + +'forum_subs_none' => "You are not subscribed to any forums at present", +'f_none' => "--", +'in' => "In:", +'by' => "By:", + +'ft_forum' => "Forum", +'ft_posts' => "Replies", +'ft_topics' => "Topics", +'ft_unsub' => "Unsubscribe", +'ft_newpost' => "Start New Topic", +'ft_last_post' => "Last Post", + +'ft_unsub_all' => "Unsubscribe from all forums", + +'subs_today' => "Last day", +'subs_day' => "Last %s days", +'subs_all' => "the beginning", + +'show_topics_from' => "Show topics from:", + +'subs_none' => "There are no subscriptions to show, try selecting a less restrictive date range", + +'auto_prune' => "Note: Subscriptions are pruned if there is no reply to the topic after %s days", +'no_auto_prune' => "Subscription auto pruning is switched off at present", + +'auto_track' => "Enable 'Email Notification' by default?
    Enabling this option will automatically subscribe you to any topic you start or reply to.", + +'cf_required' => "Required Information, this section must be completed", + +'pp_number_posts' => "Number of posts to show for each topic page", +'pp_number_topics' => "Number of topics to show for each forum page", +'pp_use_default' => "Use forum default", + +'mess_saved' => "Saved (Unsent) PM's", +'dst_box' => "Is daylight savings time in effect?
    (If you have selected the correct time zone and the clock appears
    an hour out, check or uncheck box to suit)", @@ -20,14 +56,17 @@ $lang = array ( 'av_tt_one' => "I don't wish to use an avatar (remove all current)", 'av_tt_two' => "Selecting this option will remove all current avatars if you have any selected/uploaded or entered in the URL field", -'mess_new' => "Send New PM", +'mess_new' => "Compose New Message", -'mess_contact' => "Contact List", -'mess_folders' => "Edit Folders", +'mess_contact' => "PM Buddies/Block List", +'mess_folders' => "Edit Storage Folders", 'mess_inbox' => "Go to Inbox", 'mess_archive' => "Archive Messages", +'mess_tracker' => "Message Tracker", + + 'forum_jump' => "Forum Jump", @@ -46,8 +85,9 @@ $lang = array ( 'm_email_change' => "Change Email Address", 'm_passy_opt' => "Change Password", -'m_tracker' => "Topic Tracker", -'m_view_subs' => "View subscriptions", +'m_tracker' => "Subscriptions", +'m_view_subs' => "View Topics", +'m_view_forum' => "View Forums", 'm_links' => "Personal Links", 'm_edit_links' => "Edit Links", @@ -212,7 +252,7 @@ month10 => "October", month11 => "November", account => "Modify Account", month12 => "December", -hide_email => "Hide my email address from other members", +hide_email => "Hide my email address from other members
    Enabling this option will deny other members sending you an email via the board.", account_email_txt => "Your Email Address", settings_skin => "Board 'Skin'", account_pass_new2 => "Please confirm your NEW password", @@ -230,7 +270,7 @@ t_title => "Your control panel", av_none_selected => "[ No Avatar Selected ]", subs_header => "Current Subscriptions", -profile_title => "Your personal profile", +profile_title => "Your personal profile, this section is optional", board_prefs => "Board Preferences", subs_left => "Days Left", subs_topic => "Topic", @@ -253,7 +293,7 @@ avatar_click => "Click on one of the avatars in this list to add it into the location => "Your Location", avatar_url_ext => "The following file types are allowed: ", email_address => "Your registered email address", -pm_reminder => "Send a confirmation email when I receive a new private message", +pm_reminder => "Send a confirmation email when I receive a new private message
    Enabling this option will send an email confirmation of any new private messages sent to you.", subs_last_post => "Last Post", email => "Email Settings", account_email_submit => "Change my Email Address", @@ -264,7 +304,7 @@ email_help => "This is where you can change your email settings", settings_dopopup => "Do you wish to get a pop up notification when you get a new private message?", settings_display => "Board Display Settings", settings_skin_txt => "You may choose a 'skin' to use.
    This will change the way the board looks", -send_full_msg => "Include a copy of the post when emailing me from a subscribed topic", +send_full_msg => "Include a copy of the post when emailing me from a subscribed topic
    Enabling this option will send a plain text version of the post in the subscription email.", member_title => "Custom member title", yes => "Yes", account_pass_new => "Enter your NEW password", @@ -273,20 +313,17 @@ js_interests => "Interests", av_preset => "You are currently using a pre-installed avatar", aol => "Your AOL identity", settings_lang => "Board Interface Language", -end_subs => "Number of days a topic subscription lasts
    (This is useful to automatically unsubscribe from a subscription after the number of days entered have passed)", pixels => "pixels", t_welcome => "Welcome to your control panel", personal => "Personal Info", daily_average => "Average number of posts per day", avatar_ops => "Avatar Options", account_pass_submit => "Change my Password", -profile_header => ", you may create and/or amend your personal profile. This will be viewable by everyone. All of this information is optional", stats_header => "Your account summary", settings_time => "Time Zone", subs_title => "Your Topic Subscriptions", no_posts => "You've yet to post", subs => "Topic Tracker", -subs_none => "You are not subscribed to any topics", current_avatar => "Avatar Preview", subs_deleted => "The subscription has been deleted", avatar_pre_submit => "Add this avatar to my profile", @@ -302,7 +339,7 @@ account_email_req => "You will receive an email asking you to verify this ch email_title => "Your email settings", av_current => "Your Current Avatar", check_length => "Check Length", -admin_send => "Send me any updates sent by the board administrator", +admin_send => "Send me any updates sent by the board administrator
    Enabling this option will add your email address to the administrators mail list and you will receive any updates sent.", ); diff --git a/upload/phpinfo.php b/upload/phpinfo.php deleted file mode 100644 index d2b25e4e..00000000 --- a/upload/phpinfo.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/upload/show.php b/upload/show.php new file mode 100644 index 00000000..d5bfbfee --- /dev/null +++ b/upload/show.php @@ -0,0 +1,55 @@ + + diff --git a/upload/sm_install.php b/upload/sm_install.php index cd4938f8..e996ee42 100644 --- a/upload/sm_install.php +++ b/upload/sm_install.php @@ -1,1514 +1,1773 @@ - Script written by Matthew Mecham -| > Date started: 30th March 2002 -| -+-------------------------------------------------------------------------- -*/ - -error_reporting (E_ERROR | E_WARNING | E_PARSE); -set_magic_quotes_runtime(0); - -//+--------------------------------------- -// ENTER YOUR PATH TO THE DIRECTORY THIS SCRIPT -// IS IN. -// -// Tips: -// -// If you are using Windows and Apache, do not -// use backslashes, use normal forward slashes. -// You may need to remove the drive letter also -// Example: C:\apache\htdocs\ibforums\ will need -// to be: /apache/htdocs/ibforums/ -// -// If you are using Windows and IIS, then you will -// need to enter double backslashes. -// -// In all cases, please enter a trailing slash (or -// trailing backslashes...) -//+--------------------------------------- - -$root = "./"; - - - -//+--------------------------------------- - -$template = new template; -$std = new installer; - -$VARS = $std->parse_incoming(); - -//+--------------------------------------- -// What are we doing then? Eh? I'm talking to you! -//+--------------------------------------- - -if ( file_exists($root.'install.lock') ) -{ - install_error("This installer is locked!
    Please (via FTP) remove the 'install.lock' file in this directory"); - exit(); -} - - -switch($VARS['a']) -{ - case '1': - do_setup_form(); - break; - - case '2': - do_install(); - break; - - case '3': - do_finish(); - break; - - default: - do_intro(); - break; -} - -function do_finish() -{ - global $std, $template, $root, $VARS, $SQL; - - // Attempt to lock the install.. - - if ($FH = fopen( $root.'install.lock', 'w' ) ) - { - fwrite( $FH, 'bleh', 4 ); - fclose($FH); - - @chmod( $root.'install.lock', 0666 ); - - $template->print_top('Success!'); - - $template->contents .= " - • Success! - - - - - - -
    - - - - -
    - - - - -
    - The installation is now complete! -

    - Although the installer is now locked (to re-install, remove the file 'install.lock'), for added - security, please remove the sm_install.php program before continuing. -

    -
    CLICK HERE TO LOG IN!
    -
    -
    -
    "; - } - else - { - $template->print_top('Success!'); - - $template->contents .= " - • WARNING! - - - - - - -
    - - - - -
    - - - - -
    - The installation is now complete! -

    - PLEASE REMOVE THE INSTALLER ('sm_install.php') BEFORE CONTINUING! -
    - Failure to do so will enable ANYONE to delete your board at any time! -

    -
    CLICK HERE TO LOG IN!
    -
    -
    -
    "; - } - - $template->output(); - - - -} - -//+--------------------------------------- - - -function do_install() -{ - global $std, $template, $root, $VARS, $HTTP_POST_VARS; - - // Ok, lets check for blankies... - - $NEW_INFO = array(); - - $need = array('board_url','sql_host','sql_database','sql_user','adminname','adminpassword','adminpassword2','email'); - - //----------------------------------- - - foreach($need as $greed) - { - if ($VARS[ $greed ] == "") - { - install_error("You must complete all of the form with the sole exception of 'SQL Table prefix'"); - } - } - - //----------------------------------- - - $VARS['board_url'] = preg_replace( "#/$#", "", $VARS['board_url'] ); - - if ($VARS['sql_tbl_prefix'] == "") - { - $VARS['sql_tbl_prefix'] = 'ibf_'; - } - - //----------------------------------- - // Did the admin passy and passy2 match? - //----------------------------------- - - if ($VARS['adminpassword2'] != $VARS['adminpassword']) - { - install_error("Your passwords did not match"); - } - - /*if ( ! preg_match( "!^http://!", $VARS['board_url'] ) ) - { - install_error("The board URL must start with 'http://'"); - }*/ - - //----------------------------------- - // IMPORT $INFO! - //----------------------------------- - - if ($root == './') - { - $root = str_replace( '\\', '/', getcwd() ) . '/'; - } - - $require = $root."conf_global.php"; - - if ( ! file_exists($require) ) - { - install_error("Could not locate '$require'. You may need to enter a value for the root path in this installer script, to do this, simply open up this script in a text editor and enter a value in \$root - remember to add a trailing slash. NT users will need to use double backslashes"); - } - - //@chmod( "conf_global.php", 0666 ); - - include($require); - - //echo("here"); - //exit(); - - if ( count($INFO) < 1 ) - { - install_error("Possible corruption in 'conf_global.php' ({$VARS['base_dir']}conf_global.php), please re-upload in ASCII format"); - } - - //----------------------------------- - // Attempt a DB connection.. - //----------------------------------- - - if ( ! $connect_id = mysql_connect( $VARS['sql_host'],$HTTP_POST_VARS['sql_user'],$HTTP_POST_VARS['sql_pass'] ) ) - { - install_error("Could not create a mySQL connection, please check the SQL values entered"); - } - - - if ( ! mysql_select_db($VARS['sql_database'], $connect_id) ) - { - install_error("mySQL could not locate a database called '{$VARS['sql_database']}' please check the value entered for this"); - } - - //----------------------------------- - // Attempt to write the config file. - //----------------------------------- - - $new = array( 'base_dir' => $root, - 'board_url' => $VARS['board_url'], - 'sql_host' => $VARS['sql_host'], - 'sql_database' => $VARS['sql_database'], - 'sql_user' => $HTTP_POST_VARS['sql_user'], - 'sql_pass' => $HTTP_POST_VARS['sql_pass'], - 'sql_tbl_prefix' => $VARS['sql_tbl_prefix'], - - 'html_dir' => $root."html/", - 'html_url' => $VARS['board_url']."/html", - 'upload_dir' => $root."uploads", - 'upload_url' => $VARS['board_url']."/uploads", - 'email_in' => $VARS['email'], - 'email_out' => $VARS['email'], - 'ban_names' => "", - 'ban_email' => "", - 'ban_ip' => "", - 'force_login' => 0, - 'load_limit' => "", - 'board_start' => time(), - 'installed' => 1, - 'guests_ava' => 1, - 'guests_img' => 1, - 'guests_sig' => 1, - 'print_headers' => 0, - 'guest_name_pre' => "Guest_", - ); - - foreach( $new as $k => $v ) - { - // Update the old... - - $v = preg_replace( "/'/", "\\'" , $v ); - $v = preg_replace( "/\r/", "" , $v ); - - $INFO[ $k ] = $v; - } - - $file_string = " $v ) - { - if ($k == 'skin' or $k == 'languages') - { - continue; - } - $file_string .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n"; - } - - $file_string .= "\n".'?'.'>'; // Question mark + greater than together break syntax hi-lighting in BBEdit 6 :p - - if ( $fh = fopen( $require, 'w' ) ) - { - fputs($fh, $file_string, strlen($file_string) ); - fclose($fh); - } - else - { - install_error("Could not write to 'conf_global.php'"); - } - - //----------------------------------- - // Lets populate the database! - //----------------------------------- - - $SQL = get_sql(); - - foreach( $SQL as $q ) - { - if ($VARS['sql_tbl_prefix'] != "ibf_") - { - $q = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $VARS['sql_tbl_prefix']."\\1\\2", $q); - } - - if ( preg_match("/CREATE TABLE (\S+) \(/", $q, $match) ) - { - if ($match[1]) - { - $the_query = "DROP TABLE if exists ".$match[1]; - if (! mysql_query($the_query, $connect_id) ) - { - install_error("mySQL Error: ".mysql_error()); - } - } - } - - if ( ! mysql_query($q, $connect_id) ) - { - install_error("mySQL Error: ".mysql_error()); - } - } - - // Insert the admin... - - $passy = md5($VARS['adminpassword']); - $time = time(); - - $query = "INSERT INTO ".$VARS['sql_tbl_prefix']."members (id, name, mgroup, password, email, joined, ip_address, posts, title, last_visit, last_activity) ". - "VALUES(1, '{$VARS['adminname']}', 4, '$passy', '{$VARS['email']}', '$time', '127.0.0.1', '0', 'Administrator', '$time', '$time')"; - - if ( ! mysql_query($query, $connect_id) ) - { - install_error("mySQL Error: ".mysql_error()); - - } - - // ARE WE DONE? REALLY? COOL!! - - $template->print_top('Success!'); - - $template->contents .= " - • Success! - - - - - - -
    - - - - -
    - - - - -
    - Your board has now been installed! -

    - The installation process is almost complete.. -

    -
    CLICK HERE TO COMPLETE THE INSTALL
    -
    -
    -
    "; - - $template->output(); - -} - - - - -function do_setup_form() -{ - global $std, $template, $root, $HTTP_SERVER_VARS; - - $template->print_top('Set Up form'); - - //-------------------------------------------------- - - $this_url = str_replace( "/sm_install.php", "", $HTTP_SERVER_VARS['HTTP_REFERER']); - - if ( ! $this_url ) - { - $this_url = substr($HTTP_SERVER_VARS['SCRIPT_NAME'],0, -15); - - if ($this_url == '') - { - $this_url == '/'; - } - $this_url = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].$this_url; - } - - - //-------------------------------------------------- - - $template->contents .= " - • Your Server Environment - - -
    - - - - - -
    - - - - -
    - - - - - - - - - - -
    - This section requires you to enter the paths and URL's for the board. If in doubt, please - check with your webhost before asking for support. -
    The script URL
    This is the URL (must start with http://) to the directory that this script is in
    -
    -
    - - - - - • Your SQL Environment - - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - This section requires you to enter your SQL information. If in doubt, please - check with your webhost before asking for support. You may choose to enter an existing database name, - if not - you must create a new database before continuing. -
    SQL Host
    (localhost is usually sufficient)
    SQL Database Name
    SQL Username
    SQL Password
    SQL Table Prefix(You can leave this blank)
    -
    -
    - - - • Your Admin Account - - - - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - This section requires information to create your administration account. Please - enter the data carefully! -
    Username
    Password
    Retype your password
    Email Address
    -
    -
    -
    - - - - "; - - $template->output(); - -} - -//+--------------------------------------- - -function do_intro() -{ - global $std, $template, $root; - - $template->print_top('Welcome'); - - $template->contents .= " - • Welcome! - - - - - - -
    - - - - -
    - - - - -
    - Welcome to the Invision Board Safe Mode Installer -

    - Before we go any further, please ensure that all the files have been uploaded, and that the - file 'conf_global.php' has suitable permissions to allow this script to write to it ( 0666 should be sufficient ). -

    - You will also need your SQL database name, your SQL username, your SQL password and SQL host (usually localhost). -

    - Once you have clicked on proceed, you will be taken to a form to enter information the installer needs to set up your board. -

    - PLEASE NOTE: USING THIS INSTALLER WILL DELETE ANY CURRENT INVISION BOARD DATABASE IF YOU ARE USING THE SAME TABLE PREFIX -
    -
    -
    "; - - // Check to make sure that the config file is there and it's got suitable permissions to write to: - - $file = $root."conf_global.php"; - - $warnings = array(); - - if ( ! file_exists($file) ) - { - $warnings[] = "Cannot locate the file 'conf_global.php'. This should be uploaded into the same directory as this script!"; - } - - if ( ! is_writeable($file) ) - { - $warnings[] = "Cannot write to 'conf_global.php'. Please adjust the permissions to allow this script to write to the file. if in doubt, CHMOD via FTP to 0777"; - } - - $phpversion = phpversion(); - - if ($phpversion < '4.0.0') { - $warnings[] = "You cannot install Invision Board. Invision Board requires PHP Version 4.0.0 or better."; - } - - if ( count($warnings) > 0 ) - { - - $err_string = "
    • ".implode( "
    • ", $warnings )."
    "; - - $template->contents .= " - • WARNING! - - - - - - -
    - - - - -
    - - - - -
    - The following errors must be rectified before continuing! -

    - $err_string -
    -
    -
    "; - } - else - { - $template->contents .= "
    Proceed >>"; - } - - - $template->output(); -} - - - -function install_error($msg="") -{ - global $std, $template, $root; - - $template->print_top('Warning!'); - - - - $template->contents .= " - • WARNING! - - - - - - -
    - - - - -
    - - - - -
    - The following errors must be rectified before continuing!
    Please go back and try again! -

    - $msg -
    -
    -
    "; - - - - $template->output(); -} - -//+-------------------------------------------------------------------------- -// CLASSES -//+-------------------------------------------------------------------------- - - - -class template -{ - var $contents = ""; - - function output() - { - echo $this->contents; - echo " - -

    © 2002 Invision Board (www.invisionboard.com)
    - - - "; - exit(); - } - - //-------------------------------------- - - function print_top($title="") - { - - $this->contents = " - Invision Board Set Up :: $title - - - - - - - - -
    -
    - - "; - - } - - -} - - -class installer -{ - - function parse_incoming() - { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR; - $return = array(); - - if( is_array($HTTP_GET_VARS) ) - { - while( list($k, $v) = each($HTTP_GET_VARS) ) - { - //$k = $this->clean_key($k); - if( is_array($HTTP_GET_VARS[$k]) ) - { - while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) - { - $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); - } - } - else - { - $return[$k] = $this->clean_value($v); - } - } - } - - // Overwrite GET data with post data - - if( is_array($HTTP_POST_VARS) ) - { - while( list($k, $v) = each($HTTP_POST_VARS) ) - { - //$k = $this->clean_key($k); - if ( is_array($HTTP_POST_VARS[$k]) ) - { - while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) - { - $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); - } - } - else - { - $return[$k] = $this->clean_value($v); - } - } - } - - return $return; - } - - function clean_key($key) { - - if ($key == "") - { - return ""; - } - - $key = preg_replace( "/\.\./" , "" , $key ); - $key = preg_replace( "/\_\_(.+?)\_\_/" , "" , $key ); - $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key ); - return $key; - } - - function clean_value($val) { - - if ($val == "") - { - return ""; - } - - $val = preg_replace( "/&/" , "&" , $val ); - $val = preg_replace( "//" , "-->" , $val ); - $val = preg_replace( "/\n"; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), - 2 => array( 'act' , 'group' ), - 3 => array( 'id' , $IN['id'] ), - ) , 'adform', "onSubmit='return checkform()'" ); - - - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $prefix = preg_replace( "/'/", "'", $group['prefix'] ); - $prefix = preg_replace( "/html .= $SKIN->start_table( "Global Settings" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Group Title" , - $SKIN->form_input("g_title", $group['g_title'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Group Icon
    (Can be omitted)" , - $SKIN->form_input("g_icon", $group['g_icon'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max upload file size (in KB)
    (Leave blank to disallow uploads)" , - $SKIN->form_input("g_attach_max", $group['g_attach_max'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Online List Format [Prefix]
    (Can be left blank)
    (Example:<span style='color:red'>)" , - $SKIN->form_input("prefix", $prefix ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Online List Format [Suffix]
    (Can be left blank)
    (Example:</span>)" , - $SKIN->form_input("suffix", $suffix ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Global Permissions" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can view board?" , - $SKIN->form_yes_no("g_view_board", $group['g_view_board'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can view OFFLINE board?" , - $SKIN->form_yes_no("g_access_offline", $group['g_access_offline'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can view member profiles and the member list?" , - $SKIN->form_yes_no("g_mem_info", $group['g_mem_info'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can view other members topics?" , - $SKIN->form_yes_no("g_other_topics", $group['g_other_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can use search?" , - $SKIN->form_yes_no("g_use_search", $group['g_use_search'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can mail members from the board?" , - $SKIN->form_yes_no("g_email_friend", $group['g_email_friend'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can edit own profile info?$guest_legend" , - $SKIN->form_yes_no("g_edit_profile", $group['g_edit_profile'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can use PM system?$guest_legend" , - $SKIN->form_yes_no("g_use_pm", $group['g_use_pm'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can Upload avatars?$guest_legend" , - $SKIN->form_yes_no("g_avatar_upload", $group['g_avatar_upload'] ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Posting Permissions" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can post new topics (where allowed)?" , - $SKIN->form_yes_no("g_post_new_topics", $group['g_post_new_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can reply to OWN topics?" , - $SKIN->form_yes_no("g_reply_own_topics", $group['g_reply_own_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can reply to OTHER members topics (where allowed)?" , - $SKIN->form_yes_no("g_reply_other_topics", $group['g_reply_other_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can edit own posts?$guest_legend" , - $SKIN->form_yes_no("g_edit_posts", $group['g_edit_posts'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Append 'Edited by' legend?" , - $SKIN->form_yes_no("g_append_edit", $group['g_append_edit'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can delete own posts?$guest_legend" , - $SKIN->form_yes_no("g_delete_own_posts", $group['g_delete_own_posts'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can open/close own topics?$guest_legend" , - $SKIN->form_yes_no("g_open_close_posts", $group['g_open_close_posts'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can delete own topics?$guest_legend" , - $SKIN->form_yes_no("g_delete_own_topics", $group['g_delete_own_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can start new polls (where allowed)?$guest_legend" , - $SKIN->form_yes_no("g_post_polls", $group['g_post_polls'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can vote in polls (where allowed)?$guest_legend" , - $SKIN->form_yes_no("g_vote_polls", $group['g_vote_polls'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can avoid flood control?" , - $SKIN->form_yes_no("g_avoid_flood", $group['g_avoid_flood'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can avoid moderation queues?" , - $SKIN->form_yes_no("g_avoid_q", $group['g_avoid_q'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can add events to the calendar?$guest_legend" , - $SKIN->form_yes_no("g_calendar_post", $group['g_calendar_post'] ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Moderation Permissions" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Is Super Moderator (can moderate anywhere)?$guest_legend" , - $SKIN->form_yes_no("g_is_supmod", $group['g_is_supmod'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can access the Admin CP?$guest_legend" , - $SKIN->form_yes_no("g_access_cp", $group['g_access_cp'] ) - ) ); - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - //+--------------------------------------------------------------------------------- - // - // Show "Management Screen - // - //+--------------------------------------------------------------------------------- - - function main_screen() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "User Groups"; - - $ADMIN->page_detail = "User Grouping is a quick and powerful way to organise your members. There are 4 preset groups that you cannot remove (Validating, Guest, Member and Admin) although you may edit these at will. A good example of user grouping is to set up a group called 'Moderators' and allow them access to certain forums other groups do not have access to.
    Forum access allows you to make quick changes to that groups forum read, write and reply settings. You may do this on a forum per forum basis in forum control."; - - $g_array = array(); - - $SKIN->td_header[] = array( "Group Title" , "30%" ); - $SKIN->td_header[] = array( "ACP" , "5%" ); - $SKIN->td_header[] = array( "SMOD" , "5%" ); - $SKIN->td_header[] = array( "Members" , "10%" ); - $SKIN->td_header[] = array( "Edit Group" , "20%" ); - $SKIN->td_header[] = array( "Forum Access" , "20%" ); - $SKIN->td_header[] = array( "Delete" , "10%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "User Group Management" ); - - $DB->query("SELECT ibf_groups.g_id, ibf_groups.g_access_cp, ibf_groups.g_is_supmod, ibf_groups.g_title,ibf_groups.prefix, ibf_groups.suffix, COUNT(ibf_members.id) as count FROM ibf_groups " - ."LEFT JOIN ibf_members ON (ibf_members.mgroup = ibf_groups.g_id) " - ."GROUP BY ibf_groups.g_id ORDER BY ibf_groups.g_title"); - - while ( $r = $DB->fetch_row() ) - { - - $del = ""; - $mod = ' '; - $adm = ' '; - - if ($r['g_id'] > 4) - { - $del = "
    Delete
    "; - } - //----------------------------------- - if ($r['g_access_cp'] == 1) - { - $adm = '
    Y
    '; - } - //----------------------------------- - if ($r['g_is_supmod'] == 1) - { - $mod = '
    Y
    '; - } - - if ($r['g_id'] != 1 and $r['g_id'] != 2) - { - $total_linkage = "".$r['prefix'].$r['g_title'].$r['suffix'].""; - } - else - { - $total_linkage = $r['prefix'].$r['g_title'].$r['suffix']; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "$total_linkage" , - $adm, - $mod, - "
    ".$r['count']."
    ", - "
    Edit Group
    ", - "
    Forum Access
    ", - $del - - ) ); - - $g_array[] = array( $r['g_id'], $r['g_title'] ); - } - - $ADMIN->html .= $SKIN->add_td_basic(" ", "center", "title"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'group' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Add a new member group" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Base new group on..." , - $SKIN->form_dropdown("id", $g_array, 3 ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Set up New Group"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - -} - - + Admin Forum functions +| > Module written by Matt Mecham +| > Date started: 17th March 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new ad_groups(); + + +class ad_groups { + + var $base_url; + + function ad_groups() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'doadd': + $this->save_group('add'); + break; + + case 'add': + $this->group_form('add'); + break; + + case 'edit': + $this->group_form('edit'); + break; + + case 'doedit': + $this->save_group('edit'); + break; + + case 'delete': + $this->delete_form(); + break; + + case 'dodelete': + $this->do_delete(); + break; + + case 'fedit': + $this->forum_perms(); + break; + + case 'dofedit': + $this->do_forum_perms(); + break; + + default: + $this->main_screen(); + break; + } + + } + + + //+--------------------------------------------------------------------------------- + // + // Delete a group + // + //+--------------------------------------------------------------------------------- + + function forum_perms() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the group ID, please try again"); + } + + //+---------------------------------- + + $ADMIN->page_title = "User Group Forum Access Permissions"; + + $ADMIN->page_detail = "This is a quick and convenient way to organise forum access for this member group. If you wish to change multiple group permissions, then you may wish to do so from forum management.

    Simply check the box in the start column if you wish to allow that member group to start new topics in that forum, etc.
    Global indictates that the forum is set to allow all member groups to carry out that action. If you wish to change this, do so from forum control."; + + //+---------------------------------- + + $DB->query("SELECT g_title, g_id FROM ibf_groups WHERE g_id='".$IN['id']."'"); + $group = $DB->fetch_row(); + + $gid = $group['g_id']; + + //+------------------------------- + + $cats = array(); + $forums = array(); + $children = array(); + + $DB->query("SELECT * from ibf_categories WHERE id > 0 ORDER BY position ASC"); + while ($r = $DB->fetch_row()) + { + $cats[$r['id']] = $r; + } + + $DB->query("SELECT * from ibf_forums ORDER BY position ASC"); + while ($r = $DB->fetch_row()) + { + + if ($r['parent_id'] > 0) + { + $children[ $r['parent_id'] ][] = $r; + } + else + { + $forums[] = $r; + } + + } + + //+---------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dofedit' ), + 2 => array( 'act' , 'group' ), + 3 => array( 'id' , $gid ), + ) ); + + $SKIN->td_header[] = array( "Forum Name" , "20%" ); + $SKIN->td_header[] = array( "Posts" , "10%" ); + $SKIN->td_header[] = array( "Topics" , "10%" ); + $SKIN->td_header[] = array( "Start" , "15%" ); + $SKIN->td_header[] = array( "Reply" , "15%" ); + $SKIN->td_header[] = array( "Read" , "15%" ); + $SKIN->td_header[] = array( "Upload" , "15%" ); + + $ADMIN->html .= $SKIN->start_table( "Forum Access for ".$group['g_title'] ); + + $last_cat_id = -1; + + foreach ($cats as $c) + { + + $ADMIN->html .= $SKIN->add_td_basic( $c['name'], 'center', 'catrow' ); + + $last_cat_id = $c['id']; + + + foreach($forums as $r) + { + + if ($r['category'] == $last_cat_id) + { + + $read = ""; + $start = ""; + $reply = ""; + $upload = ""; + $global = '
    Global
    '; + + if ($r['read_perms'] == '*') + { + $read = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $r['read_perms'] ) ) + { + $read = "
    "; + } + else + { + $read = "
    "; + } + + //--------------------------- + + if ($r['start_perms'] == '*') + { + $start = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $r['start_perms'] ) ) + { + $start = "
    "; + } + else + { + $start = "
    "; + } + + //--------------------------- + + if ($r['reply_perms'] == '*') + { + $reply = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $r['reply_perms'] ) ) + { + $reply = "
    "; + } + else + { + $reply = "
    "; + } + + //--------------------------- + + if ($r['upload_perms'] == '*') + { + $upload = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $r['upload_perms'] ) ) + { + $upload = "
    "; + } + else + { + $upload = "
    "; + } + + //--------------------------- + + if ($r['subwrap'] == 1) + { + $ADMIN->html .= $SKIN->add_td_basic( "> ".$r['name'], 'left', 'catrow2' ); + } + else + { + $ADMIN->html .= $SKIN->add_td_row( array( + "".$r['name']."
    ".$r['description'], + "
    ".$r['posts']."
    ", + "
    ".$r['topics']."
    ", + $start, + $reply, + $read, + $upload + ) ); + } + + if ( ( isset($children[ $r['id'] ]) ) and ( count ($children[ $r['id'] ]) > 0 ) ) + { + foreach($children[ $r['id'] ] as $idx => $rd) + { + $read = ""; + $start = ""; + $reply = ""; + $upload = ""; + $global = '
    Global
    '; + + if ($rd['read_perms'] == '*') + { + $read = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $rd['read_perms'] ) ) + { + $read = "
    "; + } + else + { + $read = "
    "; + } + + //--------------------------- + + if ($rd['start_perms'] == '*') + { + $start = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $rd['start_perms'] ) ) + { + $start = "
    "; + } + else + { + $start = "
    "; + } + + //--------------------------- + + if ($rd['reply_perms'] == '*') + { + $reply = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $rd['reply_perms'] ) ) + { + $reply = "
    "; + } + else + { + $reply = "
    "; + } + + //--------------------------- + + if ($rd['upload_perms'] == '*') + { + $upload = $global; + } + else if ( preg_match( "/(^|,)".$gid."(,|$)/", $rd['upload_perms'] ) ) + { + $upload = "
    "; + } + else + { + $upload = "
    "; + } + + //--------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( + "".$rd['name']."
    ".$rd['description'], + "
    ".$rd['posts']."
    ", + "
    ".$rd['topics']."
    ", + $start, + $reply, + $read, + $upload + ) , 'subforum' ); + } + } + } + } + } + + $ADMIN->html .= $SKIN->end_form("Update Forum Permissions"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + function do_forum_perms() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //--------------------------- + // Check for legal ID + //--------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve that group ID"); + } + + $gid = $IN['id']; + + //--------------------------- + + $DB->query("SELECT g_id, g_title FROM ibf_groups WHERE g_id='".$IN['id']."'"); + + if ( ! $gr = $DB->fetch_row() ) + { + $ADMIN->error("Not a valid group ID"); + } + + //--------------------------- + // Pull the forum data.. + //--------------------------- + + $forum_q = $DB->query("SELECT id, read_perms, start_perms, reply_perms, upload_perms FROM ibf_forums ORDER BY position ASC"); + + while ( $row = $DB->fetch_row( $forum_q ) ) + { + + $read = ""; + $reply = ""; + $start = ""; + $upload = ""; + //--------------------------- + // Is this global? + //--------------------------- + + if ($row['read_perms'] == '*') + { + $read = '*'; + + } + else + { + //--------------------------- + // Split the set IDs + //--------------------------- + + $read_ids = explode( ",", $row['read_perms'] ); + + if ( is_array($read_ids) ) + { + foreach ($read_ids as $i) + { + //--------------------------- + // If it's the current ID, skip + //--------------------------- + + if ($gid == $i) + { + continue; + } + else + { + $read .= $i.","; + } + } + } + //--------------------------- + // Was the box checked? + //--------------------------- + + if ($IN[ 'read_'.$row['id'] ] == 1) + { + // Add our group ID... + + $read .= $gid.","; + } + + // Tidy.. + + $read = preg_replace( "/,$/", "", $read ); + $read = preg_replace( "/^,/", "", $read ); + + } + + //--------------------------- + // Reply topics.. + //--------------------------- + + if ($row['reply_perms'] == '*') + { + $reply = '*'; + } + else + { + $reply_ids = explode( ",", $row['reply_perms'] ); + + if ( is_array($reply_ids) ) + { + + foreach ($reply_ids as $i) + { + if ($gid == $i) + { + continue; + } + else + { + $reply .= $i.","; + } + } + + } + + if ($IN[ 'reply_'.$row['id'] ] == 1) + { + $reply .= $gid.","; + } + + $reply = preg_replace( "/,$/", "", $reply ); + $reply = preg_replace( "/^,/", "", $reply ); + } + + //--------------------------- + // Start topics.. + //--------------------------- + + if ($row['start_perms'] == '*') + { + $start = '*'; + } + else + { + $start_ids = explode( ",", $row['start_perms'] ); + + if ( is_array($start_ids) ) + { + + foreach ($start_ids as $i) + { + if ($gid == $i) + { + continue; + } + else + { + $start .= $i.","; + } + } + + } + + if ($IN[ 'start_'.$row['id'] ] == 1) + { + $start .= $gid.","; + } + + $start = preg_replace( "/,$/", "", $start ); + $start = preg_replace( "/^,/", "", $start ); + } + + //--------------------------- + // Upload topics.. + //--------------------------- + + if ($row['upload_perms'] == '*') + { + $upload = '*'; + } + else + { + $upload_ids = explode( ",", $row['upload_perms'] ); + + if ( is_array($upload_ids) ) + { + + foreach ($upload_ids as $i) + { + if ($gid == $i) + { + continue; + } + else + { + $upload .= $i.","; + } + } + + } + + if ($IN[ 'upload_'.$row['id'] ] == 1) + { + $upload .= $gid.","; + } + + $upload = preg_replace( "/,$/", "", $upload ); + $upload = preg_replace( "/^,/", "", $upload ); + } + + //--------------------------- + // Update the DB... + //--------------------------- + + if (! $new_q = $DB->query("UPDATE ibf_forums SET read_perms='$read', reply_perms='$reply', start_perms='$start', upload_perms='$upload' WHERE id='".$row['id']."'") ) + { + die ("Update query failed on Forum ID ".$row['id']); + } + + } + + $ADMIN->save_log("Forum Access Permissions Edited for group '{$gr['g_title']}'"); + + $ADMIN->done_screen("Forum Access Permissions Updated", "Group Control", "act=group" ); + + } + + //+--------------------------------------------------------------------------------- + // + // Delete a group + // + //+--------------------------------------------------------------------------------- + + function delete_form() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the group ID, please try again"); + } + + if ($IN['id'] < 5) + { + $ADMIN->error("You can not move the preset groups. You can rename them and edit the functionality"); + } + + $ADMIN->page_title = "Deleting a User Group"; + + $ADMIN->page_detail = "Please check to ensure that you are attempting to remove the correct group."; + + + //+------------------------------- + + $DB->query("SELECT COUNT(id) as users FROM ibf_members WHERE mgroup='".$IN['id']."'"); + $black_adder = $DB->fetch_row(); + + if ($black_adder['users'] < 1) + { + $black_adder['users'] = 0; + } + + $DB->query("SELECT g_title FROM ibf_groups WHERE g_id='".$IN['id']."'"); + $group = $DB->fetch_row(); + + //+------------------------------- + + $DB->query("SELECT g_id, g_title FROM ibf_groups WHERE g_id <> '".$IN['id']."'"); + + $mem_groups = array(); + + while ( $r = $DB->fetch_row() ) + { + $mem_groups[] = array( $r['g_id'], $r['g_title'] ); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dodelete' ), + 2 => array( 'act' , 'group' ), + 3 => array( 'id' , $IN['id'] ), + 4 => array( 'name' , $group['g_title'] ), + ) ); + + + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Removal Confirmation: ".$group['g_title'] ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of users in this group" , + "".$black_adder['users']."", + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Move users in this group to..." , + $SKIN->form_dropdown("to_id", $mem_groups ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Delete this group"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + function do_delete() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the group ID, please try again"); + } + + if ($IN['to_id'] == "") + { + $ADMIN->error("No move to group ID was specified. /me cries."); + } + + // Check to make sure that the relevant groups exist. + + $DB->query("SELECT g_id FROM ibf_groups WHERE g_id IN(".$IN['id'].",".$IN['to_id'].")"); + + if ( $DB->get_num_rows() != 2 ) + { + $ADMIN->error("Could not resolve the ID's passed to group deletion"); + } + + $DB->query("UPDATE ibf_members SET mgroup='".$IN['to_id']."' WHERE mgroup='".$IN['id']."'"); + + $DB->query("DELETE FROM ibf_groups WHERE g_id='".$IN['id']."'"); + + // Look for promotions in case we have members to be promoted to this group... + + $prq = $DB->query("SELECT g_id FROM ibf_groups WHERE g_promotion LIKE '{$IN['id']}&%'"); + + while ( $row = $DB->fetch_row($prq) ) + { + $nq = $DB->query("UPDATE ibf_groups SET g_promotion='-1&-1' WHERE g_id='".$row['g_id']."'"); + } + + $ADMIN->save_log("Member Group '{$IN['name']}' removed"); + + $ADMIN->done_screen("Group Removed", "Group Control", "act=group" ); + + } + + + //+--------------------------------------------------------------------------------- + // + // Save changes to DB + // + //+--------------------------------------------------------------------------------- + + function save_group($type='edit') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['g_title'] == "") + { + $ADMIN->error("You must enter a group title."); + } + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the group id"); + } + + if ($IN['id'] == $INFO['admin_group'] and $IN['g_access_cp'] != 1) + { + $ADMIN->error("You can not remove the ability to access the admin control panel for this group"); + } + } + + // Build up the hashy washy for the database ..er.. wase. + + $prefix = preg_replace( "/'/", "'" , stripslashes($HTTP_POST_VARS['prefix']) ); + $prefix = preg_replace( "/</" , "<" , $prefix ); + $suffix = preg_replace( "/'/", "'" , stripslashes($HTTP_POST_VARS['suffix']) ); + $suffix = preg_replace( "/</" , "<" , $suffix ); + + $promotion_a = '-1'; //id + $promotion_b = '-1'; // posts + + if ($IN['g_promotion_id'] > 0) + { + $promotion_a = $IN['g_promotion_id']; + $promotion_b = $IN['g_promotion_posts']; + } + + + $db_string = array( + 'g_view_board' => $IN['g_view_board'], + 'g_mem_info' => $IN['g_mem_info'], + 'g_other_topics' => $IN['g_other_topics'], + 'g_use_search' => $IN['g_use_search'], + 'g_email_friend' => $IN['g_email_friend'], + 'g_invite_friend' => $IN['g_invite_friend'], + 'g_edit_profile' => $IN['g_edit_profile'], + 'g_post_new_topics' => $IN['g_post_new_topics'], + 'g_reply_own_topics' => $IN['g_reply_own_topics'], + 'g_reply_other_topics' => $IN['g_reply_other_topics'], + 'g_edit_posts' => $IN['g_edit_posts'], + 'g_edit_cutoff' => $IN['g_edit_cutoff'], + 'g_delete_own_posts' => $IN['g_delete_own_posts'], + 'g_open_close_posts' => $IN['g_open_close_posts'], + 'g_delete_own_topics' => $IN['g_delete_own_topics'], + 'g_post_polls' => $IN['g_post_polls'], + 'g_vote_polls' => $IN['g_vote_polls'], + 'g_use_pm' => $IN['g_use_pm'], + 'g_is_supmod' => $IN['g_is_supmod'], + 'g_access_cp' => $IN['g_access_cp'], + 'g_title' => trim($IN['g_title']), + 'g_can_remove' => $IN['g_can_remove'], + 'g_append_edit' => $IN['g_append_edit'], + 'g_access_offline' => $IN['g_access_offline'], + 'g_avoid_q' => $IN['g_avoid_q'], + 'g_avoid_flood' => $IN['g_avoid_flood'], + 'g_icon' => trim($IN['g_icon']), + 'g_attach_max' => $IN['g_attach_max'], + 'g_avatar_upload' => $IN['g_avatar_upload'], + 'g_calendar_post' => $IN['g_calendar_post'], + 'g_max_messages' => $IN['g_max_messages'], + 'g_max_mass_pm' => $IN['g_max_mass_pm'], + 'g_search_flood' => $IN['g_search_flood'], + 'prefix' => $prefix, + 'suffix' => $suffix, + 'g_promotion' => $promotion_a.'&'.$promotion_b, + 'g_hide_from_list' => $IN['g_hide_from_list'], + 'g_post_closed' => $IN['g_post_closed'], + + ); + + if ($type == 'edit') + { + $rstring = $DB->compile_db_update_string( $db_string ); + + $DB->query("UPDATE ibf_groups SET $rstring WHERE g_id='".$IN['id']."'"); + + // Update the title of the group held in the mod table incase it changed. + + $DB->query("UPDATE ibf_moderators SET group_name='".trim($IN['g_title'])."' WHERE group_id='".$IN['id']."'"); + + $ADMIN->save_log("Edited Group '{$IN['g_title']}'"); + + $ADMIN->done_screen("Group Edited", "Group Control", "act=group" ); + + } + else + { + $rstring = $DB->compile_db_insert_string( $db_string ); + + $DB->query("INSERT INTO ibf_groups (" .$rstring['FIELD_NAMES']. ") VALUES (". $rstring['FIELD_VALUES'] .")"); + + $ADMIN->save_log("Added Group '{$IN['g_title']}'"); + + $ADMIN->done_screen("Group Added", "Group Control", "act=group" ); + } + } + + + //+--------------------------------------------------------------------------------- + // + // Add / edit group + // + //+--------------------------------------------------------------------------------- + + function group_form($type='edit') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $all_groups = array( 0 => array ('none', 'Don\'t Promote') ); + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("No group id to select from the database, please try again."); + } + + $form_code = 'doedit'; + $button = 'Complete Edit'; + + } + else + { + $form_code = 'doadd'; + $button = 'Add Group'; + } + + if ($IN['id'] != "") + { + $DB->query("SELECT * FROM ibf_groups WHERE g_id='".$IN['id']."'"); + $group = $DB->fetch_row(); + + $query = "SELECT g_id, g_title FROM ibf_groups WHERE g_id <> {$IN['id']} ORDER BY g_title"; + } + else + { + $group = array(); + + $query = "SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"; + } + + //------------------------------------------- + // sort out the promotion stuff + //------------------------------------------- + + list($group['g_promotion_id'], $group['g_promotion_posts']) = explode( '&', $group['g_promotion'] ); + + if ($group['g_promotion_posts'] < 1) + { + $group['g_promotion_posts'] = ''; + } + + $DB->query($query); + + while ( $r = $DB->fetch_row() ) + { + $all_groups[] = array( $r['g_id'], $r['g_title'] ); + } + + //------------------------------------------- + + if ($type == 'edit') + { + $ADMIN->page_title = "Editing User Group ".$group['g_title']; + } + else + { + $ADMIN->page_title = 'Adding a new user group'; + $group['g_title'] = 'New Group'; + } + + $guest_legend = ""; + + if ($group['g_id'] == $INFO['guest_group']) + { + $guest_legend = "

    (Does not apply to guests)"; + } + + $ADMIN->page_detail = "Please double check the information before submitting the form."; + + + //+------------------------------- + + $ADMIN->html .= "\n"; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), + 2 => array( 'act' , 'group' ), + 3 => array( 'id' , $IN['id'] ), + ) , 'adform', "onSubmit='return checkform()'" ); + + + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $prefix = preg_replace( "/'/", "'", $group['prefix'] ); + $prefix = preg_replace( "/html .= $SKIN->start_table( "Global Settings" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Group Title" , + $SKIN->form_input("g_title", $group['g_title'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Group Icon
    (Can be omitted)" , + $SKIN->form_input("g_icon", $group['g_icon'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max upload file size (in KB)
    (Leave blank to disallow uploads)" , + $SKIN->form_input("g_attach_max", $group['g_attach_max'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Online List Format [Prefix]
    (Can be left blank)
    (Example:<span style='color:red'>)" , + $SKIN->form_input("prefix", $prefix ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Online List Format [Suffix]
    (Can be left blank)
    (Example:</span>)" , + $SKIN->form_input("suffix", $suffix ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Hide this group from the member list?" , + $SKIN->form_yes_no("g_hide_from_list", $group['g_hide_from_list'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Global Permissions" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can view board?" , + $SKIN->form_yes_no("g_view_board", $group['g_view_board'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can view OFFLINE board?" , + $SKIN->form_yes_no("g_access_offline", $group['g_access_offline'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can view member profiles and the member list?" , + $SKIN->form_yes_no("g_mem_info", $group['g_mem_info'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can view other members topics?" , + $SKIN->form_yes_no("g_other_topics", $group['g_other_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can use search?" , + $SKIN->form_yes_no("g_use_search", $group['g_use_search'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of seconds for search flood control
    Stops search abuse, enter 0 or leave blank for no flood control" , + $SKIN->form_input("g_search_flood", $group['g_search_flood'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can mail members from the board?" , + $SKIN->form_yes_no("g_email_friend", $group['g_email_friend'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can edit own profile info?$guest_legend" , + $SKIN->form_yes_no("g_edit_profile", $group['g_edit_profile'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can use PM system?$guest_legend" , + $SKIN->form_yes_no("g_use_pm", $group['g_use_pm'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. Number users allowed to mass PM?$guest_legend
    (Enter 0 or leave blank to disable mass PM)" , + $SKIN->form_input("g_max_mass_pm", $group['g_max_mass_pm'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. Number of storable messages?$guest_legend" , + $SKIN->form_input("g_max_messages", $group['g_max_messages'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can Upload avatars?$guest_legend" , + $SKIN->form_yes_no("g_avatar_upload", $group['g_avatar_upload'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Posting Permissions" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can post new topics (where allowed)?" , + $SKIN->form_yes_no("g_post_new_topics", $group['g_post_new_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can reply to OWN topics?" , + $SKIN->form_yes_no("g_reply_own_topics", $group['g_reply_own_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can reply to OTHER members topics (where allowed)?" , + $SKIN->form_yes_no("g_reply_other_topics", $group['g_reply_other_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can edit own posts?$guest_legend" , + $SKIN->form_yes_no("g_edit_posts", $group['g_edit_posts'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Edit time restriction (in minutes)?$guest_legend
    Denies user edit after the time set has passed. Leave blank or enter 0 for no restriction" , + $SKIN->form_input("g_edit_cutoff", $group['g_edit_cutoff'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow user to remove 'Edited by' legend?" , + $SKIN->form_yes_no("g_append_edit", $group['g_append_edit'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can delete own posts?$guest_legend" , + $SKIN->form_yes_no("g_delete_own_posts", $group['g_delete_own_posts'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can open/close own topics?$guest_legend" , + $SKIN->form_yes_no("g_open_close_posts", $group['g_open_close_posts'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can delete own topics?$guest_legend" , + $SKIN->form_yes_no("g_delete_own_topics", $group['g_delete_own_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can start new polls (where allowed)?$guest_legend" , + $SKIN->form_yes_no("g_post_polls", $group['g_post_polls'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can vote in polls (where allowed)?$guest_legend" , + $SKIN->form_yes_no("g_vote_polls", $group['g_vote_polls'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can avoid flood control?" , + $SKIN->form_yes_no("g_avoid_flood", $group['g_avoid_flood'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can avoid moderation queues?" , + $SKIN->form_yes_no("g_avoid_q", $group['g_avoid_q'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can add events to the calendar?$guest_legend" , + $SKIN->form_yes_no("g_calendar_post", $group['g_calendar_post'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Moderation Permissions" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Is Super Moderator (can moderate anywhere)?$guest_legend" , + $SKIN->form_yes_no("g_is_supmod", $group['g_is_supmod'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can access the Admin CP?$guest_legend" , + $SKIN->form_yes_no("g_access_cp", $group['g_access_cp'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow user group to post in 'closed' topics?" , + $SKIN->form_yes_no("g_post_closed", $group['g_post_closed'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Group Promotion" ); + + if ($group['g_id'] == $INFO['admin_group']) + { + $ADMIN->html .= $SKIN->add_td_row( array( "Choose 'Don't Promote' to disable promotions
    ".$SKIN->js_help_link('mg_promote') , + "Feature disable for the root admin group, after all - if you're at the top where can you be promoted to?" + ) ); + } + else + { + $ADMIN->html .= $SKIN->add_td_row( array( "Choose 'Don't Promote' to disable promotions
    ".$SKIN->js_help_link('mg_promote') , + 'Promote members of this group to: '.$SKIN->form_dropdown("g_promotion_id", $all_groups, $group['g_promotion_id'] ) + .'
    when they reach '.$SKIN->form_simple_input('g_promotion_posts', $group['g_promotion_posts'] ).' posts' + ) ); + } + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + // + // Show "Management Screen + // + //+--------------------------------------------------------------------------------- + + function main_screen() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "User Groups"; + + $ADMIN->page_detail = "User Grouping is a quick and powerful way to organise your members. There are 4 preset groups that you cannot remove (Validating, Guest, Member and Admin) although you may edit these at will. A good example of user grouping is to set up a group called 'Moderators' and allow them access to certain forums other groups do not have access to.
    Forum access allows you to make quick changes to that groups forum read, write and reply settings. You may do this on a forum per forum basis in forum control."; + + $g_array = array(); + + $SKIN->td_header[] = array( "Group Title" , "30%" ); + $SKIN->td_header[] = array( "ACP" , "5%" ); + $SKIN->td_header[] = array( "SMOD" , "5%" ); + $SKIN->td_header[] = array( "Members" , "10%" ); + $SKIN->td_header[] = array( "Edit Group" , "20%" ); + $SKIN->td_header[] = array( "Forum Access" , "20%" ); + $SKIN->td_header[] = array( "Delete" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "User Group Management" ); + + $DB->query("SELECT ibf_groups.g_id, ibf_groups.g_access_cp, ibf_groups.g_is_supmod, ibf_groups.g_title,ibf_groups.prefix, ibf_groups.suffix, COUNT(ibf_members.id) as count FROM ibf_groups " + ."LEFT JOIN ibf_members ON (ibf_members.mgroup = ibf_groups.g_id) " + ."GROUP BY ibf_groups.g_id ORDER BY ibf_groups.g_title"); + + while ( $r = $DB->fetch_row() ) + { + + $del = ""; + $mod = ' '; + $adm = ' '; + + if ($r['g_id'] > 4) + { + $del = "
    Delete
    "; + } + //----------------------------------- + if ($r['g_access_cp'] == 1) + { + $adm = '
    Y
    '; + } + //----------------------------------- + if ($r['g_is_supmod'] == 1) + { + $mod = '
    Y
    '; + } + + if ($r['g_id'] != 1 and $r['g_id'] != 2) + { + $total_linkage = "".$r['prefix'].$r['g_title'].$r['suffix'].""; + } + else + { + $total_linkage = $r['prefix'].$r['g_title'].$r['suffix']; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "$total_linkage" , + $adm, + $mod, + "
    ".$r['count']."
    ", + "
    Edit Group
    ", + "
    Forum Access
    ", + $del + + ) ); + + $g_array[] = array( $r['g_id'], $r['g_title'] ); + } + + $ADMIN->html .= $SKIN->add_td_basic(" ", "center", "title"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'group' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Add a new member group" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Base new group on..." , + $SKIN->form_dropdown("id", $g_array, 3 ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Set up New Group"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_help.php b/upload/sources/Admin/ad_help.php index b0b08bb4..1bd52ba5 100644 --- a/upload/sources/Admin/ad_help.php +++ b/upload/sources/Admin/ad_help.php @@ -1,273 +1,279 @@ - Help Control functions -| > Module written by Matt Mecham -| > Date started: 2nd April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'edit': - $this->show_form('edit'); - break; - case 'new': - $this->show_form('new'); - break; - - case 'doedit': - $this->doedit(); - break; - - case 'donew': - $this->doadd(); - break; - - case 'remove': - $this->remove(); - break; - - //------------------------- - default: - $this->list_files(); - break; - } - - } - - //------------------------------------------------------------- - // HELP FILE FUNCTIONS - //------------------------------------------------------------- - - function doedit() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid emoticon id, silly!"); - } - - $text = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['text'] ) ); - $title = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['title'] ) ); - $desc = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['description'] ) ); - - $db_string = $DB->compile_db_update_string( array( 'title' => $title, - 'text' => $text, - 'description' => $desc, - ) ); - - $DB->query("UPDATE ibf_faq SET $db_string WHERE id='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=help"); - exit(); - - - } - - //===================================================== - - - function show_form($type='new') - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You may add/edit and remove help files below."; - $ADMIN->page_title = "Help File Management"; - - //+------------------------------- - - if ($type != 'new') - { - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid help file id, silly!"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_faq WHERE id='".$IN['id']."'"); - - if ( ! $r = $DB->fetch_row() ) - { - $ADMIN->error("We could not find that help file in the database"); - } - - //+------------------------------- - - $button = 'Edit this Help File'; - $code = 'doedit'; - } - else - { - $r = array(); - $button = 'Add this Help File'; - $code = 'donew'; - } - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), - 2 => array( 'act' , 'help' ), - 3 => array( 'id' , $IN['id'] ), - ) ); - - - - $SKIN->td_header[] = array( " " , "20%" ); - $SKIN->td_header[] = array( " " , "80%" ); - - $r['text'] = preg_replace( "/
    /i", "\n", stripslashes($r['text']) ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( $button ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Help File Title", - $SKIN->form_input('title' , stripslashes($r['title']) ), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Help File Description", - $SKIN->form_textarea('description', stripslashes($r['description']) ), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Help File Text", - $SKIN->form_textarea('text', $r['text'], "60", "10" ), - ) ); - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //===================================================== - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid help file id, silly!"); - } - - $DB->query("DELETE FROM ibf_faq WHERE id='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=help"); - exit(); - - - } - - //===================================================== - - function doadd() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['title'] == "") - { - $ADMIN->error("You must enter a title, silly!"); - } - - - - $text = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['text'] ) ); - $title = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['title'] ) ); - $desc = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['description'] ) ); - - $db_string = $DB->compile_db_insert_string( array( 'title' => $title, - 'text' => $text, - 'description' => $desc, - ) ); - - $DB->query("INSERT INTO ibf_faq (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $std->boink_it($SKIN->base_url."&act=help"); - exit(); - - - } - - //===================================================== - - function list_files() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You may add/edit and remove help files below."; - $ADMIN->page_title = "Help File Management"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Title" , "50%" ); - $SKIN->td_header[] = array( "Edit" , "30%" ); - $SKIN->td_header[] = array( "Remove" , "20%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Current Help Files" ); - - $DB->query("SELECT * from ibf_faq ORDER BY id ASC"); - - if ( $DB->get_num_rows() ) - { - while ( $r = $DB->fetch_row() ) - { - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['title'])."
    ".stripslashes($r['description']), - "
    Edit
    ", - "
    Remove
    ", - ) ); - - - - } - } - - $ADMIN->html .= $SKIN->add_td_basic("Add New Help File", "center", "title" ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $ADMIN->output(); - - } - - -} - - + Help Control functions +| > Module written by Matt Mecham +| > Date started: 2nd April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'edit': + $this->show_form('edit'); + break; + case 'new': + $this->show_form('new'); + break; + + case 'doedit': + $this->doedit(); + break; + + case 'donew': + $this->doadd(); + break; + + case 'remove': + $this->remove(); + break; + + //------------------------- + default: + $this->list_files(); + break; + } + + } + + //------------------------------------------------------------- + // HELP FILE FUNCTIONS + //------------------------------------------------------------- + + function doedit() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid emoticon id, silly!"); + } + + $text = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['text'] ) ); + $title = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['title'] ) ); + $desc = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['description'] ) ); + + $db_string = $DB->compile_db_update_string( array( 'title' => $title, + 'text' => $text, + 'description' => $desc, + ) ); + + $DB->query("UPDATE ibf_faq SET $db_string WHERE id='".$IN['id']."'"); + + $ADMIN->save_log("Edited help files"); + + $std->boink_it($SKIN->base_url."&act=help"); + exit(); + + + } + + //===================================================== + + + function show_form($type='new') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You may add/edit and remove help files below."; + $ADMIN->page_title = "Help File Management"; + + //+------------------------------- + + if ($type != 'new') + { + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid help file id, silly!"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_faq WHERE id='".$IN['id']."'"); + + if ( ! $r = $DB->fetch_row() ) + { + $ADMIN->error("We could not find that help file in the database"); + } + + //+------------------------------- + + $button = 'Edit this Help File'; + $code = 'doedit'; + } + else + { + $r = array(); + $button = 'Add this Help File'; + $code = 'donew'; + } + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), + 2 => array( 'act' , 'help' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + + + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "80%" ); + + $r['text'] = preg_replace( "/
    /i", "\n", stripslashes($r['text']) ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( $button ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Help File Title", + $SKIN->form_input('title' , stripslashes($r['title']) ), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Help File Description", + $SKIN->form_textarea('description', stripslashes($r['description']) ), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Help File Text", + $SKIN->form_textarea('text', $r['text'], "60", "10" ), + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //===================================================== + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid help file id, silly!"); + } + + $DB->query("DELETE FROM ibf_faq WHERE id='".$IN['id']."'"); + + $ADMIN->save_log("Removed a help file"); + + $std->boink_it($SKIN->base_url."&act=help"); + exit(); + + + } + + //===================================================== + + function doadd() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['title'] == "") + { + $ADMIN->error("You must enter a title, silly!"); + } + + + + $text = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['text'] ) ); + $title = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['title'] ) ); + $desc = preg_replace( "/\n/", "
    ", stripslashes($HTTP_POST_VARS['description'] ) ); + + $db_string = $DB->compile_db_insert_string( array( 'title' => $title, + 'text' => $text, + 'description' => $desc, + ) ); + + $DB->query("INSERT INTO ibf_faq (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + $ADMIN->save_log("Added a help file"); + + $std->boink_it($SKIN->base_url."&act=help"); + exit(); + + + } + + //===================================================== + + function list_files() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You may add/edit and remove help files below."; + $ADMIN->page_title = "Help File Management"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Title" , "50%" ); + $SKIN->td_header[] = array( "Edit" , "30%" ); + $SKIN->td_header[] = array( "Remove" , "20%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Current Help Files" ); + + $DB->query("SELECT * from ibf_faq ORDER BY id ASC"); + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['title'])."
    ".stripslashes($r['description']), + "
    Edit
    ", + "
    Remove
    ", + ) ); + + + + } + } + + $ADMIN->html .= $SKIN->add_td_basic("Add New Help File", "center", "title" ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $ADMIN->output(); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_imagemacros.php b/upload/sources/Admin/ad_imagemacros.php index cfe47ab0..84d00179 100644 --- a/upload/sources/Admin/ad_imagemacros.php +++ b/upload/sources/Admin/ad_imagemacros.php @@ -1,605 +1,857 @@ - Skin -> Image Macro functions -| > Module written by Matt Mecham -| > Date started: 4th April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'wrapper': - $this->list_current(); - break; - - case 'add': - $this->add_images(); - break; - - case 'edit': - $this->do_form('edit'); - break; - - case 'doadd': - $this->save_wrapper('add'); - break; - - case 'doedit': - $this->save_wrapper('edit'); - break; - - case 'remove': - $this->remove(); - break; - - case 'export': - $this->export(); - - //------------------------- - default: - $this->list_current(); - break; - } - - } - - - - function export() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_images WHERE imid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $archive_dir = $INFO['base_dir']."/archive_out"; - $images_dir = $INFO['base_dir']."/style_images/".$row['imid']; - - require $root_dir."sources/lib/tar.php"; - - if (!is_dir($archive_dir)) - { - $ADMIN->error("Could not locate $archive_dir, is the directory there?"); - } - - if (!is_writeable($archive_dir)) - { - $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); - } - - if (!is_dir($images_dir)) - { - $ADMIN->error("Could not locate $images_dir, is the directory there?"); - } - - //+------------------------------- - // Attempt to copy the files to the - // working directory... - //+------------------------------- - - $l_name = preg_replace( "/\s{1,}/", "_", $row['setname'] ); - - $new_dir = "image-".$l_name; - - if ( ! $ADMIN->copy_dir($images_dir, $archive_dir."/".$new_dir) ) - { - $ADMIN->error( $ADMIN->errors ); - } - - // Generate the config file.. - - $file_content = " $v) - { - - $v = preg_replace( "#style_images/".$row['imid']."/#", "style_images/%img_dir%/", $v ); - - $file_content .= "\n\$config['$k'] = \"".addslashes($v)."\";"; - } - - $file_content .= "\n\n?".">"; - - $FH = fopen($archive_dir."/".$new_dir."/"."conf.inc", 'w'); - fwrite($FH, $file_content, strlen($file_content)); - fclose($FH); - - // Add files and write tarball - - $tar = new tar(); - - $tar->new_tar( $archive_dir, $new_dir.".tar" ); - $tar->add_directory( $archive_dir."/".$new_dir ); - $tar->write_tar(); - - // Check for errors. - - if ($tar->error != "") - { - $ADMIN->error($tar->error); - } - - // remove original unarchived directory - - $ADMIN->rm_dir($archive_dir."/".$new_dir); - - $ADMIN->done_screen("Template Pack Export Created

    You can download the tar-chive here", "Manage Template Sets", "act=templ" ); - - - } - - //------------------------------------------------------------- - // Add images.. - //------------------------------------------------------------- - - - function add_images() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - //------------------------------------- - - if ( ! is_writeable($root_path.'style_images') ) - { - $ADMIN->error("The directory 'style_images' is not writeable by this script. Please check the permissions on that directory. CHMOD to 0777 if in doubt and try again"); - } - - //------------------------------------- - - if ( ! is_dir($root_path.'style_images/'.$IN['id']) ) - { - $ADMIN->error("Could not locate the original image set to copy, please check and try again"); - } - - //------------------------------------- - - $DB->query("SELECT * FROM ibf_images WHERE imid='".$IN['id']."'"); - - //------------------------------------- - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query that image set from the DB, so there"); - } - - //------------------------------------- - - $row['setname'] = $row['setname'].".2"; - - // Insert a new row into the DB... - - $final = array(); - - foreach($row as $k => $v) - { - if ($k == 'imid') - { - continue; - } - else - { - $final[ $k ] = $v; - } - } - - $db_string = $DB->compile_db_insert_string( $final ); - - $DB->query("INSERT INTO ibf_images (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $new_id = $DB->get_insert_id(); - - //------------------------------------- - - if ( ! $ADMIN->copy_dir( $INFO['base_dir'].'style_images/'.$IN['id'] , $INFO['base_dir'].'style_images/'.$new_id ) ) - { - $DB->query("DELETE FROM ibf_images WHERE imid='$new_id'"); - - $ADMIN->error( $ADMIN->errors ); - } - - //------------------------------------- - // Pass to edit / add form... - //------------------------------------- - - $this->do_form('add', $new_id); - - } - - //------------------------------------------------------------- - // REMOVE WRAPPERS - //------------------------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - $dir_to_remove = $INFO['base_dir']."style_images/".$IN['id']; - - if ( SAFE_MODE_ON == 0 ) - { - if ( $ADMIN->rm_dir( $dir_to_remove ) ) - { - - $DB->query("DELETE FROM ibf_images WHERE imid='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=image"); - exit(); - } - else - { - $ADMIN->error("Could not remove the image pack files, please check the CHMOD permissions to ensure that this script has the correct permissions to allow this"); - } - } - else - { - $DB->query("DELETE FROM ibf_images WHERE imid='".$IN['id']."'"); - $ADMIN->info_screen("Safe mode has been detected and this script cannot remove the images and directories for you, please remove the directory '$dir_to_remove' via FTP. The data has been removed from the database successfully"); - } - } - - - - //------------------------------------------------------------- - // ADD / EDIT IMAGE SETS - //------------------------------------------------------------- - - function save_wrapper() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - - if ($IN['setname'] == "") - { - $ADMIN->error("You must specify a name for this image and macro set"); - } - - $barney = array(); - - foreach ($IN as $k => $v) - { - if ( preg_match( "/^XX_(\S+)$/", $k, $match ) ) - { - if ( isset($IN[ $match[0] ]) ) - { - $v = preg_replace( "/'/", "'", stripslashes($HTTP_POST_VARS[ $match[0] ]) ); - - $barney[ $match[1] ] = $v; - } - } - } - - if ( count($barney) < 10 ) - { - $ADMIN->error("Oopsie, something has gone wrong - did you leave all the fields blank?"); - } - - $barney['setname'] = $IN['setname']; - - $db_string = $DB->compile_db_update_string( $barney ); - - $DB->query("UPDATE ibf_images SET $db_string WHERE imid='".$IN['id']."'"); - - $ADMIN->done_screen("Set updated", "Manage Image and Macro Sets", "act=image" ); - - - - } - - //------------------------------------------------------------- - // ADD / EDIT MACRO SETS - //------------------------------------------------------------- - - function do_form( $type='add', $id="" ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - - if ($id != "") - { - $IN['id'] = $id; - } - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_images WHERE imid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - if ($type == 'add') - { - $button = 'Update Image & Macro set'; - - foreach( $row as $k => $v ) - { - $v = preg_replace( "#style_images/(\d+)/#", "style_images/".$IN['id']."/", $v ); - - $row[$k] = $v; - } - - } - else - { - $button = 'Edit Image & Macro set'; - } - - //+------------------------------- - - $ADMIN->page_detail = "You may use edit the macros that power the images. You do not have to use an image, you may use text, flash or other objects."; - $ADMIN->page_title = "Manage Image & Macro sets"; - - //+------------------------------- - - - $ADMIN->html .= $SKIN->js_no_specialchars(); - - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), - 2 => array( 'act' , 'image' ), - 3 => array( 'id' , $IN['id'] ), - ), "theAdminForm", "onSubmit=\"return no_specialchars('images')\"" ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "20%" ); - $SKIN->td_header[] = array( " " , "80%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Image & Macro set title" ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Image & Macro Set Title", - $SKIN->form_input('setname', $row['setname']), - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( "Macro" , "20%" ); - $SKIN->td_header[] = array( "Source" , "60%" ); - $SKIN->td_header[] = array( "Current" , "20%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Current Macros" ); - - foreach($row as $k => $v) - { - if ($k != 'imid' && $k != 'setname') - { - if ( ! preg_match( "/^\d+$/", $k ) ) - { - - $real = preg_replace( "/'/", "'", $v ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "$k", - $SKIN->form_input('XX_'.$k, $real), - "$v", - ) ); - } - } - } - - - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - - } - - //------------------------------------------------------------- - // SHOW WRAPPERS - //------------------------------------------------------------- - - function list_current() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - - $ADMIN->page_detail = "Images and Macros are used in the skin templates as shorthand for an image or other style information. This enables you to use text links instead of buttons or flash movies for certain images. An image and macro set contains the actual images and the macros to power them."; - $ADMIN->page_title = "Manage Image and Macros"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Title" , "40%" ); - $SKIN->td_header[] = array( "Allocation" , "30%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - //+------------------------------- - - $DB->query("SELECT DISTINCT(s.img_id), i.imid, i.setname, s.sname from ibf_images i, ibf_skins s WHERE s.img_id=i.imid ORDER BY i.setname ASC"); - - $used_ids = array(); - $show_array = array(); - - if ( $DB->get_num_rows() ) - { - - $ADMIN->html .= $SKIN->start_table( "Current Image & Macro sets In Use" ); - - while ( $r = $DB->fetch_row() ) - { - - $show_array[ $r['imid'] ] .= stripslashes($r['sname'])."
    "; - - if ( in_array( $r['imid'], $used_ids ) ) - { - continue; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['setname'])."", - "<#X-{$r['imid']}#>", - "
    Export
    ", - "
    Edit
    ", - "Deallocate before removing", - ) ); - - $used_ids[] = $r['imid']; - - $form_array[] = array( $r['imid'], $r['setname'] ); - - } - - foreach( $show_array as $idx => $string ) - { - $string = preg_replace( "/
    $/", "", $string ); - - $ADMIN->html = preg_replace( "/<#X-$idx#>/", "$string", $ADMIN->html ); - } - - $ADMIN->html .= $SKIN->end_table(); - } - - if ( count($used_ids) > 0 ) - { - - $DB->query("SELECT imid, setname FROM ibf_images WHERE imid NOT IN(".implode(",",$used_ids).")"); - - if ( $DB->get_num_rows() ) - { - - $SKIN->td_header[] = array( "Title" , "70%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Current Unallocated Image & Macro sets" ); - - $ADMIN->html .= $SKIN->js_checkdelete(); - - while ( $r = $DB->fetch_row() ) - { - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['setname'])."", - "
    Export
    ", - "
    Edit
    ", - "
    Remove
    ", - ) ); - - $form_array[] = array( $r['imid'], $r['setname'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - } - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'image' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Create New Image & Macro Set" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Base new Image & Macro set on...
    (Note: This will also copy the images)" , - $SKIN->form_dropdown( "id", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Create new Image & Macro set"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - -} - - + Skin -> Image Macro functions +| > Module written by Matt Mecham +| > Date started: 4th April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'wrapper': + $this->list_current(); + break; + + case 'add': + $this->add_macro_set(); + break; + + case 'edit': + $this->show_macros(); + break; + + case 'doedit': + $this->edit_set_name(); + break; + + case 'macroedit': + $this->macro_form('edit'); + break; + + case 'macroadd': + $this->macro_form('add'); + break; + + case 'macroremove': + $this->macro_remove(); + break; + + case 'doeditmacro': + $this->macro_edit(); + break; + + case 'doaddmacro': + $this->macro_add(); + break; + + case 'remove': + $this->remove(); + break; + + case 'export': + $this->export(); + break; + + case 'import': + $this->import(); + break; + + //------------------------- + default: + $this->list_current(); + break; + } + + } + + function import() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_FILES; + + $FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name']; + $FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size']; + $FILE_TYPE = $HTTP_POST_FILES['FILE_UPLOAD']['type']; + + // Naughty Opera adds the filename on the end of the + // mime type - we don't want this. + + $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); + + // Naughty Mozilla likes to use "none" to indicate an empty upload field. + // I love universal languages that aren't universal. + + if ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "" or !$HTTP_POST_FILES['FILE_UPLOAD']['name'] or ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "none") ) + { + // We're adding new templates based on another set + + $ADMIN->error("No file was chosen to upload, please go back and try again"); + } + + if (! is_dir($INFO['upload_dir']) ) + { + $ADMIN->error("Could not locate the uploads directory - make sure the 'uploads' path is set correctly"); + } + + //------------------------------------------------- + // Copy the upload to the uploads directory + //------------------------------------------------- + + if (! @move_uploaded_file( $HTTP_POST_FILES['FILE_UPLOAD']['tmp_name'], $INFO['upload_dir']."/".$FILE_NAME) ) + { + $ADMIN->error("The upload failed"); + } + else + { + @chmod( $INFO['upload_dir']."/".$FILE_NAME, 0777 ); + } + + //------------------------------------------------- + // Attempt to open the file.. + //------------------------------------------------- + + $filename = $INFO['upload_dir']."/".$FILE_NAME; + + if ( $FH = @fopen( $filename, 'r' ) ) + { + $data = @fread( $FH, filesize($filename) ); + @fclose($FH); + + @unlink($filename); + } + else + { + $ADMIN->error("Could not open the uploaded file for reading!"); + } + + //------------------------------------------------- + // If we're here, we'll assume that we've read the + // file and the contents are in $data + // So, lets make sure its the correct macro file.. + //------------------------------------------------- + + if ( ! preg_match( "/~=~/", $data ) ) + { + $ADMIN->error("This file does not appear to be a valid Invision Board macro file"); + } + + //------------------------------------- + // Get the new set_id + //------------------------------------- + + $DB->query("SELECT MAX(set_id) as max FROM ibf_macro_name"); + + $max = $DB->fetch_row(); + + $new_id = $max['max'] + 1; + + //------------------------------------- + // Process data + //------------------------------------- + + $init_array = array(); + $final_keys = array(); + + $init_array = explode("\n", $data); + + foreach( $init_array as $l ) + { + if (preg_match( "~=~", $l ) ) + { + // is valid line + + list($k, $v) = explode( "~=~", $l ); + + $k = trim($k); + $v = trim($v); + + $final_keys[$k] = $v; + } + } + + //------------------------------------- + // Insert the data in the DB + //------------------------------------- + + foreach( $final_keys as $k => $v) + { + if ($v == '*UNASSIGNED*') + { + $v = ""; + } + + $str = $DB->compile_db_insert_string( array ( + 'macro_value' => stripslashes($k), + 'macro_replace' => stripslashes($v), + 'macro_set' => $new_id, + 'can_remove' => 1, + ) ); + + $DB->query("INSERT INTO ibf_macro ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + } + + //---------------------------------- + // Insert macro name into DB + //---------------------------------- + + $set_name = "New Macro Set (Upload ID: ".substr( time(), -6 ).")"; + + $str = $DB->compile_db_insert_string( array ( 'set_name' => $set_name, + 'set_id' => $new_id, + ) ); + + $DB->query("INSERT INTO ibf_macro_name ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + + $ADMIN->done_screen("Macro Set Import Complete", "Manage Macro Sets", "act=image" ); + + } + + //------------------------------------------------------------- + // Edit set name + //------------------------------------------------------------- + + function edit_set_name() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + $DB->query("SELECT * FROM ibf_macro WHERE macro_id='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not retrieve the record from the DB"); + } + + $DB->query("UPDATE ibf_macro_name SET set_name='{$IN['macro_name']}' WHERE set_id='".$IN['id']."'"); + + $ADMIN->done_screen("Macro Set Updated", "Manage Macro Set {$row['macro_name']}", "act=image&code=edit&id={$row['macro_set']}" ); + + } + + //------------------------------------------------------------- + // Apply the edit to the DB + //------------------------------------------------------------- + + function macro_remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['mid'] == "") + { + $ADMIN->error("You must specify an existing macro ID, go back and try again"); + } + + $DB->query("SELECT * FROM ibf_macro WHERE macro_id='".$IN['mid']."'"); + + $row = $DB->fetch_row(); + + $DB->query("DELETE FROM ibf_macro WHERE macro_id='".$IN['mid']."'"); + + $ADMIN->done_screen("Macro Removed", "Manage Macro Set {$row['macro_name']}", "act=image&code=edit&id={$row['macro_set']}" ); + + } + + //------------------------------------------------------------- + // Apply the edit to the DB + //------------------------------------------------------------- + + function macro_edit() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['mid'] == "") + { + $ADMIN->error("You must specify an existing image set ID, go back and try again"); + } + + $DB->query("SELECT * FROM ibf_macro WHERE macro_id='".$IN['mid']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not retrieve the record from the DB"); + } + + $key = str_replace( "'", "\\'", stripslashes($HTTP_POST_VARS['macro_value']) ); + $val = str_replace( "'", "\\'", stripslashes($HTTP_POST_VARS['macro_replace']) ); + + $DB->query("UPDATE ibf_macro SET macro_value='$key', macro_replace='$val' WHERE macro_id='".$IN['mid']."'"); + + $ADMIN->done_screen("Macro Updated", "Manage Macro Set {$row['macro_name']}", "act=image&code=edit&id={$row['macro_set']}" ); + + } + + //------------------------------------------------ + + + function macro_add() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + $DB->query("SELECT * FROM ibf_macro WHERE macro_set='".$IN['id']."' LIMIT 0,1"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not retrieve the record from the DB"); + } + + $str = $DB->compile_db_insert_string( array ( + 'macro_value' => stripslashes($HTTP_POST_VARS['macro_value']), + 'macro_replace' => stripslashes($HTTP_POST_VARS['macro_replace']), + 'can_remove' => 1, + 'macro_set' => $row['macro_set'] + ) ); + + $DB->query("INSERT INTO ibf_macro ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + + $ADMIN->done_screen("Macro Added", "Manage Macro Set {$row['macro_name']}", "act=image&code=edit&id={$row['macro_set']}" ); + + } + + //------------------------------------------------------------- + // Print the edit/add formy wormy + //------------------------------------------------------------- + + function macro_form($type='edit') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + + if ($type == 'edit') + { + + if ($IN['mid'] == "") + { + $ADMIN->error("You must specify an existing macro ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT m.*, mn.set_name from ibf_macro m, ibf_macro_name mn WHERE macro_id='".$IN['mid']."' AND mn.set_id=m.macro_set"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + $button = "Edit this Macro"; + $title = "Editing Macro in set {$row['set_name']}"; + $code = 'doeditmacro'; + + } + else + { + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT set_name from ibf_macro_name WHERE set_id='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + $code = 'doaddmacro'; + $title = "Adding Macro to set {$row['set_name']}"; + $button = 'Add this Macro'; + } + + //+------------------------------- + + $ADMIN->page_detail = "The macro 'key' will be useable in any wrapper or template file.
    + Example: If you added a key of 'green_font' and a replacement of '<font color='green'>', each instance of <{green_font}> would be converted to <font color='green'> +
    <#IMG_DIR#> is available to any macro, this is automatically replaced with the name of the image directory you choose when using this macro set in a skin"; + $ADMIN->page_title = "Manage Macro Set: {$row['set_name']}"; + + //+------------------------------- + + + $ADMIN->html .= $SKIN->js_no_specialchars(); + + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), + 2 => array( 'act' , 'image' ), + 3 => array( 'id' , $IN['id'] ), + 4 => array( 'mid' , $IN['mid'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "80%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( $title ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Macro Key", + "<{".$SKIN->form_input('macro_value', $row['macro_value'])."}>", + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Macro Replacement", + $SKIN->form_textarea('macro_replace', $row['macro_replace']), + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + } + + + + //+------------------------------- + + + function export() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing image set ID, go back and try again"); + } + + $DB->query("SELECT set_name FROM ibf_macro_name WHERE set_id='".$IN['id']."'"); + + $name = $DB->fetch_row(); + + //+------------------------------- + // Pass file as an attachment, yeah! + //+------------------------------- + + $l_name = preg_replace( "/\s{1,}/", "_", $name['set_name'] ); + + $file_name = "macro-".substr($l_name, 0, 8).".txt"; + + $contents = ""; + + $DB->query("SELECT macro_replace, macro_value FROM ibf_macro WHERE macro_set='".$IN['id']."'"); + + while( $row = $DB->fetch_row() ) + { + if ($row['macro_replace'] == "") + { + $row['macro_replace'] = "*UNASSIGNED*"; + } + $contents .= $row['macro_value']."~=~".$row['macro_replace']."\n"; + } + + @header("Content-type: unknown/unknown"); + @header("Content-Disposition: attachment; filename=$file_name"); + + print $contents."\n"; + + exit(); + + } + + //------------------------------------------------------------- + // Add images.. + //------------------------------------------------------------- + + + function add_macro_set() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + + $DB->query("SELECT * FROM ibf_macro_name WHERE set_id='".$IN['id']."'"); + + //------------------------------------- + + if ( ! $mac = $DB->fetch_row() ) + { + $ADMIN->error("Could not query that macro set from the DB, so there"); + } + + //------------------------------------- + + $mac['set_name'] = $mac['set_name']." (Copy)"; + + //------------------------------------- + // Get the new set_id + //------------------------------------- + + $DB->query("SELECT MAX(set_id) as max FROM ibf_macro_name"); + + $max = $DB->fetch_row(); + + $new_id = $max['max'] + 1; + + $q1 = $DB->query("SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set='{$IN['id']}'"); + + while( $row = $DB->fetch_row($q1) ) + { + $str = $DB->compile_db_insert_string( array ( + 'macro_value' => stripslashes($row['macro_value']), + 'macro_replace' => stripslashes($row['macro_replace']), + 'macro_set' => $new_id, + 'can_remove' => 1, + ) ); + + $q2 = $DB->query("INSERT INTO ibf_macro ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + //$q2 = $DB->query("INSERT INTO ibf_macro SET macro_value='{$row['macro_value']}',macro_replace='{$row['macro_replace']}', macro_set='$new_id'"); + } + + $DB->query("INSERT INTO ibf_macro_name SET set_id='$new_id', set_name='{$mac['set_name']}'"); + + $ADMIN->done_screen("Macro Set Added", "Manage Macro Sets", "act=image" ); + + } + + //------------------------------------------------------------- + // REMOVE WRAPPERS + //------------------------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + $DB->query("DELETE FROM ibf_macro WHERE macro_set='".$IN['id']."'"); + + $DB->query("DELETE FROM ibf_macro_name WHERE set_id='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=image"); + } + + + + + //------------------------------------------------------------- + // ADD / EDIT MACRO SETS + //------------------------------------------------------------- + + function show_macros() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing macro set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT m.*, ms.* from ibf_macro m, ibf_macro_name ms WHERE m.macro_set='".$IN['id']."' AND ms.set_id=m.macro_set LIMIT 0,1"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $ADMIN->page_detail = "To edit a macro, simply click on the 'edit' link of the appropriate macro. +
    The macro 'key' will be useable in any wrapper or template file.
    + Example: If you added a key of 'green_font' and a replacement of '<font color='green'>', each instance of <{green_font}> would be converted to <font color='green'> +
    <#IMG_DIR#> is available to any macro, this is automatically replaced with the name of the image directory you choose when using this macro set in a skin"; + $ADMIN->page_title = "Manage Macro Set: {$row['set_name']}"; + + //+------------------------------- + + + $ADMIN->html .= $SKIN->js_no_specialchars(); + $ADMIN->html .= $SKIN->js_checkdelete(); + + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), + 2 => array( 'act' , 'image' ), + 3 => array( 'id' , $IN['id'] ), + ), "theAdminForm", "onSubmit=\"return no_specialchars('images')\"" ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "80%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Edit Macro Set Title" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Macro Set Title", + $SKIN->form_input('macro_name', $row['set_name']), + ) ); + + $ADMIN->html .= $SKIN->end_form("Edit Macro Title"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( "Macro Key" , "20%" ); + $SKIN->td_header[] = array( "Macro Replacement" , "45%" ); + $SKIN->td_header[] = array( "Preview" , "15%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Current Macros ["."Add a macro"." ]" ); + + // Get img_dir this set is using... + + $DB->query("SELECT img_dir from ibf_skins WHERE macro_id='".$IN['id']."'"); + + $skin = $DB->fetch_row(); + + $DB->query("SELECT * from ibf_macro WHERE macro_set='".$IN['id']."'"); + + while( $row = $DB->fetch_row() ) + { + + $real = str_replace( "<", "<", $row['macro_replace'] ); + $real = str_replace( ">", ">", $real ); + + if ( strlen($real) > 55 ) + { + $real = substr( $real, 0, 52 ) . '...'; + } + + $preview = str_replace( "<#IMG_DIR#>", $skin['img_dir'], $row['macro_replace'] ); + + $remove = "Cannot remove"; + + if ($row['can_remove'] == 1) + { + $remove = "
    Remove
    "; + + } + + + $ADMIN->html .= $SKIN->add_td_row( array( + "{$row['macro_value']}", + $real, + $preview, + "
    Edit
    ", + $remove, + ) ); + } + + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + + } + + //------------------------------------------------------------- + // SHOW WRAPPERS + //------------------------------------------------------------- + + function list_current() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + + $ADMIN->page_detail = "You may manage your macro sets from this section. This enables you to use text links instead of buttons or flash movies for certain images."; + $ADMIN->page_title = "Manage Macro Sets"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Title" , "40%" ); + $SKIN->td_header[] = array( "Allocation" , "30%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + //+------------------------------- + + $DB->query("SELECT DISTINCT(s.macro_id), i.macro_set, ms.set_name, s.sname from ibf_macro i, ibf_macro_name ms, ibf_skins s WHERE s.macro_id=i.macro_set AND ms.set_id=i.macro_set ORDER BY ms.set_name ASC"); + + $used_ids = array(); + $show_array = array(); + + if ( $DB->get_num_rows() ) + { + + $ADMIN->html .= $SKIN->start_table( "Current Macro sets In Use" ); + + while ( $r = $DB->fetch_row() ) + { + + $show_array[ $r['macro_set'] ] .= stripslashes($r['sname'])."
    "; + + if ( in_array( $r['macro_set'], $used_ids ) ) + { + continue; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['set_name'])."", + "<#X-{$r['macro_set']}#>", + "
    Export
    ", + "
    Edit
    ", + "Deallocate before removing", + ) ); + + $used_ids[] = $r['macro_set']; + + $form_array[] = array( $r['macro_set'], $r['set_name'] ); + + } + + foreach( $show_array as $idx => $string ) + { + $string = preg_replace( "/
    $/", "", $string ); + + $ADMIN->html = preg_replace( "/<#X-$idx#>/", "$string", $ADMIN->html ); + } + + $ADMIN->html .= $SKIN->end_table(); + } + + if ( count($used_ids) > 0 ) + { + + $DB->query("SELECT set_id, set_name FROM ibf_macro_name WHERE set_id NOT IN(".implode(",",$used_ids).")"); + + if ( $DB->get_num_rows() ) + { + + $SKIN->td_header[] = array( "Title" , "70%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Current Unallocated Macro sets" ); + + $ADMIN->html .= $SKIN->js_checkdelete(); + + while ( $r = $DB->fetch_row() ) + { + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['set_name'])."", + "
    Export
    ", + "
    Edit
    ", + "
    Remove
    ", + ) ); + + $form_array[] = array( $r['set_id'], $r['set_name'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + } + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'image' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Create a New Macro Set" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Base the new Macro set on..." , + $SKIN->form_dropdown( "id", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Create a new Macro set"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'import' ), + 2 => array( 'act' , 'image' ), + 3 => array( 'MAX_FILE_SIZE', '10000000000' ), + ) , "uploadform", " enctype='multipart/form-data'" ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Import a Macro Set" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "OR Choose a file from your computer to import
    Note: This must be a valid macro set.", + $SKIN->form_upload(), + ) ); + + $ADMIN->html .= $SKIN->end_form("Import Macro Set"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_index.php b/upload/sources/Admin/ad_index.php index c5d7d885..6d3c98b5 100644 --- a/upload/sources/Admin/ad_index.php +++ b/upload/sources/Admin/ad_index.php @@ -1,204 +1,209 @@ - Admin "welcome" screen functions -| > Module written by Matt Mecham -| > Date started: 1st march 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - - -$idx = new index_page(); - - -class index_page { - - - function index_page() { - global $DB, $IN, $INFO, $ADMIN, $SKIN, $std; - - $DB->query("SELECT * FROM ibf_stats"); - - $row = $DB->fetch_row(); - - if ($row['TOTAL_REPLIES'] < 0) $row['TOTAL_REPLIES'] = 0; - if ($row['TOTAL_TOPICS'] < 0) $row['TOTAL_TOPICS'] = 0; - if ($row['MEM_COUNT'] < 0) $row['MEM_COUNT'] = 0; - - $DB->query("SELECT COUNT(*) as reg FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' AND (new_pass='' or new_pass IS NULL)"); - $reg = $DB->fetch_row(); - - if ($reg['reg'] < 1 ) $reg['reg'] = 0; - - //------------------------------------------------- - // Make sure the uploads path is correct - //------------------------------------------------- - - $uploads_size = 0; - - if ($dh = opendir( $INFO['upload_dir'] )) - { - while ( $file = readdir( $dh ) ) - { - if ( !preg_match( "/^..?$|^index/i", $file ) ) - { - $uploads_size += @filesize( $INFO['upload_dir'] . "/" . $file ); - } - } - closedir( $dh ); - } - - // This piece of code from Jesse's (jesse@jess.on.ca) contribution - // to the PHP manual @ php.net - - if ($uploads_size >= 1048576) - { - $uploads_size = round($uploads_size / 1048576 * 100 ) / 100 . " mb"; - } - else if ($uploads_size >= 1024) - { - $uploads_size = round($uploads_size / 1024 * 100 ) / 100 . " k"; - } - else - { - $uploads_size = $uploads_size . " bytes"; - } - - //+----------------------------------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Administrators using the CP" ); - - $t_time = time() - 60*10; - - $DB->query("SELECT DISTINCT(MEMBER_NAME) FROM ibf_admin_sessions WHERE RUNNING_TIME > $t_time"); - - $mem_array = array(); - - while ( $r = $DB->fetch_row() ) - { - $mem_array[] = $r['MEMBER_NAME']; - } - - $ADMIN->html .= $SKIN->add_td_basic( implode(", ", $mem_array ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+----------------------------------------------------------- - - $ADMIN->html .= $SKIN->add_td_spacer(); - - //+----------------------------------------------------------- - - $SKIN->td_header[] = array( "Definition", "25%" ); - $SKIN->td_header[] = array( "Value" , "25%" ); - $SKIN->td_header[] = array( "Definition", "25%" ); - $SKIN->td_header[] = array( "Value" , "25%" ); - - $ADMIN->html .= $SKIN->start_table( "System Overview" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Total Unique Topics" , $row['TOTAL_TOPICS'], - "Total Replies to topics" , $row['TOTAL_REPLIES'] - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Total Members" , $row['MEM_COUNT'], "Public Upload Folder Size", $uploads_size ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Users awaiting validation" , $reg['reg'], - " ", " ", - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+----------------------------------------------------------- - - $ADMIN->html .= $SKIN->add_td_spacer(); - - //+----------------------------------------------------------- - - $ADMIN->html .= $SKIN->start_form(); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "30%" ); - $SKIN->td_header[] = array( " " , "30%" ); - - $ADMIN->html .= $SKIN->start_table( "Quick Clicks" ); - - $ADMIN->html .= " - - -
    - - "; - - $ADMIN->html .= $SKIN->add_td_row( array( "Edit Member:", - "", - "" - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Add New Category:", - "", - "" - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Add New Forum:", - "", - "" - ) ); - - $ADMIN->html .= ""; - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - -} - - + Admin "welcome" screen functions +| > Module written by Matt Mecham +| > Date started: 1st march 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new index_page(); + + +class index_page { + + + function index_page() { + global $DB, $IN, $INFO, $ADMIN, $SKIN, $std; + + $DB->query("SELECT * FROM ibf_stats"); + + $row = $DB->fetch_row(); + + if ($row['TOTAL_REPLIES'] < 0) $row['TOTAL_REPLIES'] = 0; + if ($row['TOTAL_TOPICS'] < 0) $row['TOTAL_TOPICS'] = 0; + if ($row['MEM_COUNT'] < 0) $row['MEM_COUNT'] = 0; + + $DB->query("SELECT COUNT(*) as reg FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' AND (new_pass='' or new_pass IS NULL)"); + $reg = $DB->fetch_row(); + + if ($reg['reg'] < 1 ) $reg['reg'] = 0; + + $DB->query("SELECT COUNT(*) as coppa FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' AND coppa_user=1"); + $coppa = $DB->fetch_row(); + + if ($coppa['coppa'] < 1 ) $coppa['coppa'] = 0; + + //------------------------------------------------- + // Make sure the uploads path is correct + //------------------------------------------------- + + $uploads_size = 0; + + if ($dh = opendir( $INFO['upload_dir'] )) + { + while ( $file = readdir( $dh ) ) + { + if ( !preg_match( "/^..?$|^index/i", $file ) ) + { + $uploads_size += @filesize( $INFO['upload_dir'] . "/" . $file ); + } + } + closedir( $dh ); + } + + // This piece of code from Jesse's (jesse@jess.on.ca) contribution + // to the PHP manual @ php.net + + if ($uploads_size >= 1048576) + { + $uploads_size = round($uploads_size / 1048576 * 100 ) / 100 . " mb"; + } + else if ($uploads_size >= 1024) + { + $uploads_size = round($uploads_size / 1024 * 100 ) / 100 . " k"; + } + else + { + $uploads_size = $uploads_size . " bytes"; + } + + //+----------------------------------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Administrators using the CP" ); + + $t_time = time() - 60*10; + + $DB->query("SELECT DISTINCT(MEMBER_NAME) FROM ibf_admin_sessions WHERE RUNNING_TIME > $t_time"); + + $mem_array = array(); + + while ( $r = $DB->fetch_row() ) + { + $mem_array[] = $r['MEMBER_NAME']; + } + + $ADMIN->html .= $SKIN->add_td_basic( implode(", ", $mem_array ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+----------------------------------------------------------- + + $ADMIN->html .= $SKIN->add_td_spacer(); + + //+----------------------------------------------------------- + + $SKIN->td_header[] = array( "Definition", "25%" ); + $SKIN->td_header[] = array( "Value" , "25%" ); + $SKIN->td_header[] = array( "Definition", "25%" ); + $SKIN->td_header[] = array( "Value" , "25%" ); + + $ADMIN->html .= $SKIN->start_table( "System Overview" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Total Unique Topics" , $row['TOTAL_TOPICS'], + "Total Replies to topics" , $row['TOTAL_REPLIES'] + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Total Members" , $row['MEM_COUNT'], "Public Upload Folder Size", $uploads_size ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Users awaiting validation" , $reg['reg'], + "COPPA Requests from 'Users awaiting validation' total", $coppa['coppa'], + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+----------------------------------------------------------- + + $ADMIN->html .= $SKIN->add_td_spacer(); + + //+----------------------------------------------------------- + + $ADMIN->html .= $SKIN->start_form(); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "30%" ); + $SKIN->td_header[] = array( " " , "30%" ); + + $ADMIN->html .= $SKIN->start_table( "Quick Clicks" ); + + $ADMIN->html .= " + + +
    + + "; + + $ADMIN->html .= $SKIN->add_td_row( array( "Edit Member:", + "", + "" + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Add New Category:", + "", + "" + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Add New Forum:", + "", + "" + ) ); + + $ADMIN->html .= ""; + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_ips.php b/upload/sources/Admin/ad_ips.php new file mode 100644 index 00000000..5b2c38db --- /dev/null +++ b/upload/sources/Admin/ad_ips.php @@ -0,0 +1,143 @@ + IPS Remote Call thingy +| > Module written by Matt Mecham +| > Date started: 17th October 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +// Ensure we've not accessed this script directly: + + + +$idx = new ad_ips(); + + +class ad_ips { + + var $base_url; + + var $colours = array(); + + var $url = "http://www.invisionboard.com/acp/"; + + var $version = "1.1"; + + function ad_ips() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + + case 'news': + $this->news(); + break; + + case 'updates': + $this->updates(); + break; + + case 'docs': + $this->docs(); + break; + + case 'support': + $this->support(); + break; + + case 'host': + $this->host(); + break; + + case 'purchase': + $this->purchase(); + break; + + //------------------------- + default: + exit(); + break; + } + + } + + + + + function news() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + @header("Location: ".$this->url."?news"); + exit(); + } + + function updates() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //@header("Location: ".$this->url."?updates&version=".$this->version); + @header("Location: ".$this->url."?updates"); + exit(); + } + + function docs() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + @header("Location: ".$this->url."?docs"); + exit(); + } + + function support() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + @header("Location: ".$this->url."?support"); + exit(); + } + + function host() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + @header("Location: ".$this->url."?host"); + exit(); + } + + function purchase() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + @header("Location: ".$this->url."?purchase"); + exit(); + } + + + + + + + + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_languages.php b/upload/sources/Admin/ad_languages.php index 8acf2ef7..c720b534 100644 --- a/upload/sources/Admin/ad_languages.php +++ b/upload/sources/Admin/ad_languages.php @@ -1,1003 +1,1072 @@ - Language functions -| > Module written by Matt Mecham -| > Date started: 22nd April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new ad_langs(); - - -class ad_langs { - - var $base_url; - - function ad_langs() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - - case 'add': - $this->add_language(); - break; - - case 'edit': - $this->do_form('edit'); - break; - - case 'edit2': - $this->show_file(); - break; - - case 'doadd': - $this->save_wrapper('add'); - break; - - case 'doedit': - $this->save_langfile(); - break; - - case 'remove': - $this->remove(); - break; - - case 'editinfo': - $this->edit_info(); - break; - - case 'export': - $this->export(); - break; - - case 'import': - $this->import(); - break; - - case 'doimport': - $this->doimport(); - break; - - //------------------------- - default: - $this->list_current(); - break; - } - - } - - function doimport() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['tarball'] == "") - { - $ADMIN->error("You did not select a tar-chive to import!"); - } - - require $root_dir."sources/lib/tar.php"; - - $to_dir = $INFO['base_dir']."/lang"; - - $tarname = $IN['tarball']; - - $from_dir = $INFO['base_dir']."/archive_in"; - - $tar = new tar(); - - //------------------------------ - - $real_name = preg_replace( "/^lang-(\S+)\.tar$/", "\\1", $IN['tarball'] ); - - $real_name = preg_replace( "/_/", " ", $real_name ); - - //------------------------------ - - $tar->new_tar( $from_dir, $tarname ); - - $files = $tar->list_files(); - - if (count($files) > 0) - { - foreach($files as $giles) - { - if ( ! preg_match( "/^(?:[\.\w\d\+\-\_\/]+)$/", $giles) ) - { - $ADMIN->error("$tarname is possibly corrupted, please re-upload in binary"); - } - } - } - else - { - $ADMIN->error("$tarname is not a valid tar-chive"); - } - - $DB->query("INSERT INTO ibf_languages (ldir, lname) VALUES('temp', '$real_name (Import)')"); - - $new_id = $DB->get_insert_id(); - - //------------------------- - // attempt to make new dir - //------------------------- - - $dest = $to_dir."/".$new_id; - - if ( ! mkdir($dest, 0777) ) - { - $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); - - $ADMIN->error("Could not create a new directory in $to_dir, please give sufficient CHMOD permissions to allow this"); - } - - //------------------------------ - // Extract the tarball - //------------------------------ - - $tar->extract_files($dest); - - if ($tar->error != "") - { - $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); - - $ADMIN->error( $tar->error ); - } - - $extra = array( 'lauthor' => "", 'lemail' => "" ); - - if (file_exists($dest."/conf.inc")) - { - require $dest."/conf.inc"; - - $extra['lauthor'] = stripslashes($config['lauthor']); - $extra['lemail'] = stripslashes($config['lemail']); - - } - - $extra['ldir'] = $new_id; - - $db_string = $DB->compile_db_update_string($extra); - - $DB->query("UPDATE ibf_languages SET $db_string WHERE lid='$new_id'"); - - $ADMIN->done_screen("Language Pack Export Imported", "Manage Language Sets", "act=lang" ); - - } - - //-------------------------------------------- - - function import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "The tar-chive that you wish to import must reside in 'archive_in' and be a valid tar-chive uploaded in binary format."; - $ADMIN->page_title = "Language Pack Import"; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doimport' ), - 2 => array( 'act' , 'lang' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "50%" ); - $SKIN->td_header[] = array( " " , "50%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Choose a tar-chive to import" ); - - $files = $ADMIN->get_tar_names("lang-"); - - $form_array = array(); - - if (count($files) > 0) - { - foreach($files as $piles) - { - $form_array[] = array( $piles, $piles ); - } - } - - $ADMIN->html .= $SKIN->add_td_row( array( "Tar-chive to import..." , - $SKIN->form_dropdown( "tarball", $form_array ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Import!"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - - //-------------------------------------------- - - - function export() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $archive_dir = $INFO['base_dir']."/archive_out"; - $lang_dir = $INFO['base_dir']."/lang/".$row['ldir']; - - require $root_dir."sources/lib/tar.php"; - - if (!is_dir($archive_dir)) - { - $ADMIN->error("Could not locate $archive_dir, is the directory there?"); - } - - if (!is_writeable($archive_dir)) - { - $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); - } - - if (!is_dir($lang_dir)) - { - $ADMIN->error("Could not locate $lang_dir, is the directory there?"); - } - - //+------------------------------- - // Attempt to copy the files to the - // working directory... - //+------------------------------- - - $l_name = preg_replace( "/\s{1,}/", "_", $row['lname'] ); - - $new_dir = "lang-".$l_name; - - if ( ! $ADMIN->copy_dir($lang_dir, $archive_dir."/".$new_dir) ) - { - $ADMIN->error( $ADMIN->errors ); - } - - // Generate the config file.. - - $file_content = " \"".addslashes($row['lauthor'])."\", 'lemail'=>\"".addslashes($row['lemail'])."\")\n\n?".">"; - - $FH = fopen($archive_dir."/".$new_dir."/"."conf.inc", 'w'); - fwrite($FH, $file_content, strlen($file_content)); - fclose($FH); - - // Add files and write tarball - - $tar = new tar(); - - $tar->new_tar( $archive_dir, $new_dir.".tar" ); - $tar->add_directory( $archive_dir."/".$new_dir ); - $tar->write_tar(); - - // Check for errors. - - if ($tar->error != "") - { - $ADMIN->error($tar->error); - } - - // remove original unarchived directory - - $ADMIN->rm_dir($archive_dir."/".$new_dir); - - $ADMIN->done_screen("Language Pack Export Created

    You can download the tar-chive here", "Manage Language Sets", "act=lang" ); - - - } - - - - - - function show_file() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $lang_dir = $INFO['base_dir']."lang/".$row['ldir']; - - $form_array = array(); - - $lang_file = $lang_dir."/".$IN['lang_file']; - - - if ( ! is_writeable($lang_dir) ) - { - $ADMIN->error("Cannot write into '$lang_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if (! file_exists($lang_file) ) - { - $ADMIN->error("Cannot locate {$IN['lang_file']} in '$lang_dir', please go back and check the input"); - } - else - { - require $lang_file; - } - - if ($IN['lang_file'] == 'email_content.php') - { - $lang = $EMAIL; - } - - if ( ! is_writeable($lang_file) ) - { - $ADMIN->error("Cannot write to '$lang_file', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - - $ADMIN->page_detail = "You may edit any of the language information below."; - $ADMIN->page_title = "Edit Language set: ".$row['lname']; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), - 2 => array( 'act' , 'lang' ), - 3 => array( 'id' , $IN['id'] ), - 4 => array( 'lang_file' , $IN['lang_file'] ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( "Block Name" , "20%" ); - $SKIN->td_header[] = array( "Content" , "80%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Language Text: ".$IN['lang_file'] ); - - foreach($lang as $k => $v) - { - - - //+------------------------------- - // Swop < and > into ascii entities - // to prevent textarea breaking html - //+------------------------------- - - $v = stripslashes($v); - - $v = preg_replace("/&/", "&", $v ); - $v = preg_replace("//", ">", $v ); - $v = preg_replace("/'/", "'", $v ); - - if ($IN['lang_file'] == 'email_content.php') - { - $rows = 15; - - $cols = 70; - - $ADMIN->html .= $SKIN->add_td_row( array( - "<ibf.lang.".$k.">", - $SKIN->form_textarea('XX_'.$k, $v, $cols, $rows), - ) ); - } - else - { - $ADMIN->html .= $SKIN->add_td_row( array( - "<ibf.lang.".$k.">", - $SKIN->form_input('XX_'.$k, $v), - ) ); - } - - } - - - - $ADMIN->html .= $SKIN->end_form("Edit this file"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - - } - - //------------------------------------------------------------- - // Edit language pack information - //------------------------------------------------------------- - - function edit_info() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - $final['lname'] = stripslashes($HTTP_POST_VARS['lname']); - - if (isset($HTTP_POST_VARS['lname'])) - { - $final['lauthor'] = stripslashes($HTTP_POST_VARS['lauthor']); - $final['lemail'] = stripslashes($HTTP_POST_VARS['lemail']); - } - - $db_string = $DB->compile_db_update_string( $final ); - - $DB->query("UPDATE ibf_languages SET $db_string WHERE lid='".$IN['id']."'"); - - $ADMIN->done_screen("Language pack information updated", "Manage language sets", "act=lang" ); - - } - - //------------------------------------------------------------- - // Add language pack - //------------------------------------------------------------- - - - function add_language() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - - $DB->query("SELECT * FROM ibf_languages WHERE lid='".$IN['id']."'"); - - //------------------------------------- - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query that language set from the DB, so there"); - } - - //------------------------------------- - - //------------------------------------- - - if ( ! is_writeable($root_path.'lang') ) - { - $ADMIN->error("The directory 'lang' is not writeable by this script. Please check the permissions on that directory. CHMOD to 0777 if in doubt and try again"); - } - - //------------------------------------- - - if ( ! is_dir($root_path.'lang/'.$row['ldir']) ) - { - $ADMIN->error("Could not locate the original language set to copy, please check and try again"); - } - - //------------------------------------- - - $row['lname'] = $row['lname'].".2"; - - // Insert a new row into the DB... - - $final = array(); - - foreach($row as $k => $v) - { - if ($k == 'lid') - { - continue; - } - else - { - $final[ $k ] = $v; - } - } - - $db_string = $DB->compile_db_insert_string( $final ); - - $DB->query("INSERT INTO ibf_languages (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $new_id = $DB->get_insert_id(); - - //------------------------------------- - - if ( ! $ADMIN->copy_dir( $INFO['base_dir'].'lang/'.$row['ldir'] , $INFO['base_dir'].'lang/'.$new_id ) ) - { - $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); - - $ADMIN->error( $ADMIN->errors ); - } - else - { - $DB->query("UPDATE ibf_languages SET ldir='$new_id' WHERE lid='$new_id'"); - } - - //------------------------------------- - // Pass to edit / add form... - //------------------------------------- - - $this->do_form('add', $new_id); - - } - - //------------------------------------------------------------- - // REMOVE WRAPPERS - //------------------------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing image set ID, go back and try again"); - } - - if ($IN['id'] == 1) - { - $ADMIN->error("You cannot remove this language pack."); - } - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the language information from the database"); - } - - if ( $ADMIN->rm_dir( $INFO['base_dir']."lang/".$row['ldir'] ) ) - { - - $DB->query("DELETE FROM ibf_languages WHERE lid='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=lang"); - exit(); - } - else - { - $ADMIN->error("Could not remove the language pack files, please check the CHMOD permissions to ensure that this script has the correct permissions to allow this"); - } - } - - - - //------------------------------------------------------------- - // ADD / EDIT IMAGE SETS - //------------------------------------------------------------- - - function save_langfile() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - if ($IN['lang_file'] == "") - { - $ADMIN->error("You must specify an existing language filename, go back and try again"); - } - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the language information from the database"); - } - - $lang_file = $root_path."lang/".$row['ldir']."/".$IN['lang_file']; - - if (! file_exists( $lang_file ) ) - { - $ADMIN->error("Could not locate $lang_file, is it there?"); - } - - if (! is_writeable( $lang_file ) ) - { - $ADMIN->error("Cannot write to $lang_file, please chmod to 0666 or better and try again"); - } - - $barney = array(); - - foreach ($IN as $k => $v) - { - if ( preg_match( "/^XX_(\S+)$/", $k, $match ) ) - { - if ( isset($IN[ $match[0] ]) ) - { - $v = preg_replace("/'/", "'", stripslashes($HTTP_POST_VARS[ $match[0] ]) ); - $v = preg_replace("/</", "<", $v ); - $v = preg_replace("/>/", ">", $v ); - $v = preg_replace("/&/", "&", $v ); - $v = preg_replace("/\r/", "", $v ); - - $barney[ $match[1] ] = $v; - } - } - } - - if ( count($barney) < 1 ) - { - $ADMIN->error("Oopsie, something has gone wrong - did you leave all the fields blank?"); - } - - $start = " $text) - { - $text = preg_replace("/n{1,}$/", "", $text); - $start .= "\n".'$EMAIL['."'$key'".'] = << $text) - { - $start .= "\n".'$lang['."'$key'".'] = "'.addslashes($text).'";'; - } - } - - $start .= "\n\n?".">"; - - if ($fh = fopen( $lang_file, 'w') ) - { - fwrite($fh, $start, strlen($start) ); - fclose($fh); - } - else - { - $ADMIN->error("Could not write back to $lang_file"); - } - - $ADMIN->done_screen("Set updated", "Manage Language Sets", "act=lang" ); - - - - } - - //------------------------------------------------------------- - // EDIT SPLASH - //------------------------------------------------------------- - - function do_form( $method='add', $id="" ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - - if ($id != "") - { - $IN['id'] = $id; - } - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing language set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $lang_dir = $INFO['base_dir']."lang/".$row['ldir']; - - $form_array = array(); - - if ($method != 'add') - { - if ( ! is_writeable($lang_dir) ) - { - $ADMIN->error("Cannot write into '$lang_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - } - - //+------------------------------- - - if ( is_dir($lang_dir) ) - { - $handle = opendir($lang_dir); - - while (($filename = readdir($handle)) !== false) - { - if (($filename != ".") && ($filename != "..")) - { - if (preg_match("/^index/", $filename)) - { - continue; - } - - if (preg_match("/\.php$/", $filename)) - { - $form_array[] = array( $filename, preg_replace( "/\.php$/", "", $filename ) ); - } - } - } - - closedir($handle); - } - - if ($row['lauthor'] and $row['lemail']) - { - $author = "

    This language set '{$row['lname']}' was created by {$row['lauthor']}"; - } - else if ($row['lauthor']) - { - $author = "

    This language set '{$row['lname']}' was created by {$row['lauthor']}"; - } - - //+------------------------------- - - $ADMIN->page_detail = "Please choose which language section you wish to edit below.$author $url"; - $ADMIN->page_title = "Edit Language set"; - - //+------------------------------- - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'editinfo' ), - 2 => array( 'act' , 'lang' ), - 3 => array( 'id' , $IN['id'] ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "60%" ); - $SKIN->td_header[] = array( " " , "40%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Edit language set information" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( - "Language Set Name", - $SKIN->form_input('lname', $row['lname']), - ) ); - - if ($method == 'add') - { - - $ADMIN->html .= $SKIN->add_td_row( array( - "Language set author name:", - $SKIN->form_input('lauthor', $row['lauthor']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Language set author email:", - $SKIN->form_input('lemail', $row['lemail']), - ) ); - - } - - $ADMIN->html .= $SKIN->end_form("Edit language set details"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'edit2' ), - 2 => array( 'act' , 'lang' ), - 3 => array( 'id' , $IN['id'] ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "60%" ); - $SKIN->td_header[] = array( " " , "40%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Edit language files in set '".$row['lname']."'" ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Please select a language file to edit", - $SKIN->form_dropdown('lang_file', $form_array), - ) ); - - $ADMIN->html .= $SKIN->end_form("Edit this language file"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - //------------------------------------------------------------- - // SHOW ALL LANGUAGE PACKS - //------------------------------------------------------------- - - function list_current() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - - $ADMIN->page_detail = "You can edit, remove and create new language packs from this section"; - $ADMIN->page_title = "Manage Language Sets"; - - //+------------------------------- - - $DB->query("select ibf_languages.*, count(ibf_members.id) as mcount from ibf_languages left join ibf_members on(ibf_members.language=ibf_languages.ldir) where (ibf_members.language is not null or ibf_members.language = 'en') group by ibf_languages.ldir order by ibf_languages.lname"); - - - $used_ids = array(); - $show_array = array(); - - if ( $DB->get_num_rows() ) - { - - $SKIN->td_header[] = array( "Title" , "40%" ); - $SKIN->td_header[] = array( "Members" , "30%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Current Language Packs In Use" ); - - while ( $r = $DB->fetch_row() ) - { - - $show_array[ $r['lid'] ] .= stripslashes($r['lname'])."
    "; - - if ( in_array( $r['lid'], $used_ids ) ) - { - continue; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['lname'])."", - "
    {$r['mcount']}
    ", - "
    Export
    ", - "
    Edit
    ", - "Deallocate before removing", - ) ); - - $used_ids[] = $r['lid']; - - $form_array[] = array( $r['lid'], $r['lname'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - - if ( count($used_ids) < 1 ) - { - $used_ids[] = '0'; - } - $DB->query("SELECT lid, ldir, lname FROM ibf_languages WHERE lid NOT IN(".implode(",",$used_ids).")"); - - if ( $DB->get_num_rows() ) - { - - $SKIN->td_header[] = array( "Title" , "40%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "30%" ); - $SKIN->td_header[] = array( "Remove" , "20%" ); - - $ADMIN->html .= $SKIN->start_table( "Current Unallocated Language Packs" ); - - $ADMIN->html .= $SKIN->js_checkdelete(); - - while ( $r = $DB->fetch_row() ) - { - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['lname'])."", - "
    Export
    ", - "
    Edit
    ", - "
    Remove
    ", - ) ); - - $form_array[] = array( $r['lid'], $r['lname'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - //} - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'lang' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Create Language Set" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Base new language set on..." , - $SKIN->form_dropdown( "id", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Create new Language set"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - -} - - + Language functions +| > Module written by Matt Mecham +| > Date started: 22nd April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new ad_langs(); + + +class ad_langs { + + var $base_url; + + function ad_langs() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + + case 'add': + $this->add_language(); + break; + + case 'edit': + $this->do_form('edit'); + break; + + case 'edit2': + $this->show_file(); + break; + + case 'doadd': + $this->save_wrapper('add'); + break; + + case 'doedit': + $this->save_langfile(); + break; + + case 'remove': + $this->remove(); + break; + + case 'editinfo': + $this->edit_info(); + break; + + case 'export': + $this->export(); + break; + + case 'import': + $this->import(); + break; + + case 'doimport': + $this->doimport(); + break; + + case 'makedefault': + $this->make_default(); + break; + + //------------------------- + default: + $this->list_current(); + break; + } + + } + + + //-------------------------------------------- + + function make_default() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_GET_VARS; + + $new_dir = stripslashes(urldecode(trim($HTTP_GET_VARS['id']))); + + if ($new_dir == "") + { + $ADMIN->error("Could not resolve the new ID for the default lang pack stuff thingy thanks"); + } + + // Update conf file + + $ADMIN->rebuild_config( array( 'default_language' => $new_dir ) ); + + // Bring it all back to yoooo! + + $std->boink_it($SKIN->base_url."&act=lang"); + + } + + + //-------------------------------------------- + + + + + function doimport() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['tarball'] == "") + { + $ADMIN->error("You did not select a tar-chive to import!"); + } + + require $root_dir."sources/lib/tar.php"; + + $to_dir = $INFO['base_dir']."lang"; + + $tarname = $IN['tarball']; + + $from_dir = $INFO['base_dir']."archive_in"; + + $tar = new tar(); + + //------------------------------ + + $real_name = preg_replace( "/^lang-(\S+)\.tar$/", "\\1", $IN['tarball'] ); + + $real_name = preg_replace( "/_/", " ", $real_name ); + + //------------------------------ + + $tar->new_tar( $from_dir, $tarname ); + + $files = $tar->list_files(); + + if (count($files) > 0) + { + foreach($files as $giles) + { + if ( ! preg_match( "/^(?:[\.\w\d\+\-\_\/]+)$/", $giles) ) + { + $ADMIN->error("$tarname is possibly corrupted, please re-upload in binary"); + } + } + } + else + { + $ADMIN->error("$tarname is not a valid tar-chive"); + } + + $DB->query("INSERT INTO ibf_languages (ldir, lname) VALUES('temp', '$real_name (Import)')"); + + $new_id = $DB->get_insert_id(); + + //------------------------- + // attempt to make new dir + //------------------------- + + $dest = $to_dir."/".$new_id; + + if ( ! mkdir($dest, 0777) ) + { + $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); + + $ADMIN->error("Could not create a new directory in $to_dir, please give sufficient CHMOD permissions to allow this"); + } + + //------------------------------ + // Extract the tarball + //------------------------------ + + $tar->extract_files($dest); + + if ($tar->error != "") + { + $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); + + $ADMIN->error( $tar->error ); + } + + $extra = array( 'lauthor' => "", 'lemail' => "" ); + + if (file_exists($dest."/conf.inc")) + { + require $dest."/conf.inc"; + + $extra['lauthor'] = stripslashes($config['lauthor']); + $extra['lemail'] = stripslashes($config['lemail']); + + } + + $extra['ldir'] = $new_id; + + $db_string = $DB->compile_db_update_string($extra); + + $DB->query("UPDATE ibf_languages SET $db_string WHERE lid='$new_id'"); + + $ADMIN->done_screen("Language Pack Export Imported", "Manage Language Sets", "act=lang" ); + + } + + //-------------------------------------------- + + function import() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "The tar-chive that you wish to import must reside in 'archive_in' and be a valid tar-chive uploaded in binary format."; + $ADMIN->page_title = "Language Pack Import"; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doimport' ), + 2 => array( 'act' , 'lang' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "50%" ); + $SKIN->td_header[] = array( " " , "50%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Choose a tar-chive to import" ); + + $files = $ADMIN->get_tar_names("lang-"); + + $form_array = array(); + + if (count($files) > 0) + { + foreach($files as $piles) + { + $form_array[] = array( $piles, $piles ); + } + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Tar-chive to import..." , + $SKIN->form_dropdown( "tarball", $form_array ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Import!"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + + //-------------------------------------------- + + + function export() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $archive_dir = $INFO['base_dir']."/archive_out"; + $lang_dir = $INFO['base_dir']."/lang/".$row['ldir']; + + require $root_dir."sources/lib/tar.php"; + + if (!is_dir($archive_dir)) + { + $ADMIN->error("Could not locate $archive_dir, is the directory there?"); + } + + if (!is_writeable($archive_dir)) + { + $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); + } + + if (!is_dir($lang_dir)) + { + $ADMIN->error("Could not locate $lang_dir, is the directory there?"); + } + + //+------------------------------- + // Attempt to copy the files to the + // working directory... + //+------------------------------- + + $l_name = preg_replace( "/\s{1,}/", "_", $row['lname'] ); + + $new_dir = "lang-".$l_name; + + if ( ! $ADMIN->copy_dir($lang_dir, $archive_dir."/".$new_dir) ) + { + $ADMIN->error( $ADMIN->errors ); + } + + // Generate the config file.. + + $file_content = " \"".addslashes($row['lauthor'])."\", 'lemail'=>\"".addslashes($row['lemail'])."\")\n\n?".">"; + + $FH = fopen($archive_dir."/".$new_dir."/"."conf.inc", 'w'); + fwrite($FH, $file_content, strlen($file_content)); + fclose($FH); + + // Add files and write tarball + + $tar = new tar(); + + $tar->new_tar( $archive_dir, $new_dir.".tar" ); + $tar->add_directory( $archive_dir."/".$new_dir ); + $tar->write_tar(); + + // Check for errors. + + if ($tar->error != "") + { + $ADMIN->error($tar->error); + } + + // remove original unarchived directory + + $ADMIN->rm_dir($archive_dir."/".$new_dir); + + $ADMIN->done_screen("Language Pack Export Created

    You can download the tar-chive here", "Manage Language Sets", "act=lang" ); + + + } + + + + + + function show_file() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $lang_dir = $INFO['base_dir']."lang/".$row['ldir']; + + $form_array = array(); + + $lang_file = $lang_dir."/".$IN['lang_file']; + + + if ( ! is_writeable($lang_dir) ) + { + $ADMIN->error("Cannot write into '$lang_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + + if (! file_exists($lang_file) ) + { + $ADMIN->error("Cannot locate {$IN['lang_file']} in '$lang_dir', please go back and check the input"); + } + else + { + require $lang_file; + } + + if ($IN['lang_file'] == 'email_content.php') + { + $lang = $EMAIL; + } + + if ( ! is_writeable($lang_file) ) + { + $ADMIN->error("Cannot write to '$lang_file', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + + + $ADMIN->page_detail = "You may edit any of the language information below."; + $ADMIN->page_title = "Edit Language set: ".$row['lname']; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), + 2 => array( 'act' , 'lang' ), + 3 => array( 'id' , $IN['id'] ), + 4 => array( 'lang_file' , $IN['lang_file'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( "Block Name" , "20%" ); + $SKIN->td_header[] = array( "Content" , "80%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Language Text: ".$IN['lang_file'] ); + + foreach($lang as $k => $v) + { + + + //+------------------------------- + // Swop < and > into ascii entities + // to prevent textarea breaking html + //+------------------------------- + + $v = stripslashes($v); + + $v = preg_replace("/&/", "&", $v ); + $v = preg_replace("//", ">", $v ); + $v = preg_replace("/'/", "'", $v ); + + if ($IN['lang_file'] == 'email_content.php') + { + $rows = 15; + + $cols = 70; + + $ADMIN->html .= $SKIN->add_td_row( array( + "<ibf.lang.".$k.">", + $SKIN->form_textarea('XX_'.$k, $v, $cols, $rows), + ) ); + } + else + { + $ADMIN->html .= $SKIN->add_td_row( array( + "<ibf.lang.".$k.">", + $SKIN->form_input('XX_'.$k, $v), + ) ); + } + + } + + + + $ADMIN->html .= $SKIN->end_form("Edit this file"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + + } + + //------------------------------------------------------------- + // Edit language pack information + //------------------------------------------------------------- + + function edit_info() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + $final['lname'] = stripslashes($HTTP_POST_VARS['lname']); + + if (isset($HTTP_POST_VARS['lname'])) + { + $final['lauthor'] = stripslashes($HTTP_POST_VARS['lauthor']); + $final['lemail'] = stripslashes($HTTP_POST_VARS['lemail']); + } + + $db_string = $DB->compile_db_update_string( $final ); + + $DB->query("UPDATE ibf_languages SET $db_string WHERE lid='".$IN['id']."'"); + + $ADMIN->done_screen("Language pack information updated", "Manage language sets", "act=lang" ); + + } + + //------------------------------------------------------------- + // Add language pack + //------------------------------------------------------------- + + + function add_language() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + + $DB->query("SELECT * FROM ibf_languages WHERE lid='".$IN['id']."'"); + + //------------------------------------- + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query that language set from the DB, so there"); + } + + //------------------------------------- + + //------------------------------------- + + if ( ! is_writeable($root_path.'lang') ) + { + $ADMIN->error("The directory 'lang' is not writeable by this script. Please check the permissions on that directory. CHMOD to 0777 if in doubt and try again"); + } + + //------------------------------------- + + if ( ! is_dir($root_path.'lang/'.$row['ldir']) ) + { + $ADMIN->error("Could not locate the original language set to copy, please check and try again"); + } + + //------------------------------------- + + $row['lname'] = $row['lname'].".2"; + + // Insert a new row into the DB... + + $final = array(); + + foreach($row as $k => $v) + { + if ($k == 'lid') + { + continue; + } + else + { + $final[ $k ] = $v; + } + } + + $db_string = $DB->compile_db_insert_string( $final ); + + $DB->query("INSERT INTO ibf_languages (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + $new_id = $DB->get_insert_id(); + + //------------------------------------- + + if ( ! $ADMIN->copy_dir( $INFO['base_dir'].'lang/'.$row['ldir'] , $INFO['base_dir'].'lang/'.$new_id ) ) + { + $DB->query("DELETE FROM ibf_languages WHERE lid='$new_id'"); + + $ADMIN->error( $ADMIN->errors ); + } + else + { + $DB->query("UPDATE ibf_languages SET ldir='$new_id' WHERE lid='$new_id'"); + } + + //------------------------------------- + // Pass to edit / add form... + //------------------------------------- + + $this->do_form('add', $new_id); + + } + + //------------------------------------------------------------- + // REMOVE WRAPPERS + //------------------------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing image set ID, go back and try again"); + } + + if ($IN['id'] == 1) + { + $ADMIN->error("You cannot remove this language pack."); + } + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the language information from the database"); + } + + // Is it default??????????????? ok enuff + + if ($INFO['default_language'] == "") + { + $INFO['default_language'] = 'en'; + } + + if ($row['ldir'] == $INFO['default_language']) + { + $ADMIN->error("You cannot remove this language pack while it is the default language directory. Please select another pack to be the default and try again"); + } + + if ( $ADMIN->rm_dir( $INFO['base_dir']."lang/".$row['ldir'] ) ) + { + + $DB->query("DELETE FROM ibf_languages WHERE lid='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=lang"); + exit(); + } + else + { + $ADMIN->error("Could not remove the language pack files, please check the CHMOD permissions to ensure that this script has the correct permissions to allow this"); + } + } + + + + //------------------------------------------------------------- + // ADD / EDIT IMAGE SETS + //------------------------------------------------------------- + + function save_langfile() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + if ($IN['lang_file'] == "") + { + $ADMIN->error("You must specify an existing language filename, go back and try again"); + } + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the language information from the database"); + } + + $lang_file = $root_path."lang/".$row['ldir']."/".$IN['lang_file']; + + if (! file_exists( $lang_file ) ) + { + $ADMIN->error("Could not locate $lang_file, is it there?"); + } + + if (! is_writeable( $lang_file ) ) + { + $ADMIN->error("Cannot write to $lang_file, please chmod to 0666 or better and try again"); + } + + $barney = array(); + + foreach ($IN as $k => $v) + { + if ( preg_match( "/^XX_(\S+)$/", $k, $match ) ) + { + if ( isset($IN[ $match[0] ]) ) + { + $v = preg_replace("/'/", "'", stripslashes($HTTP_POST_VARS[ $match[0] ]) ); + $v = preg_replace("/</", "<", $v ); + $v = preg_replace("/>/", ">", $v ); + $v = preg_replace("/&/", "&", $v ); + $v = preg_replace("/\r/", "", $v ); + + $barney[ $match[1] ] = $v; + } + } + } + + if ( count($barney) < 1 ) + { + $ADMIN->error("Oopsie, something has gone wrong - did you leave all the fields blank?"); + } + + $start = " $text) + { + $text = preg_replace("/n{1,}$/", "", $text); + $start .= "\n".'$EMAIL['."'$key'".'] = << $text) + { + $start .= "\n".'$lang['."'$key'".'] = "'.addslashes($text).'";'; + } + } + + $start .= "\n\n?".">"; + + if ($fh = fopen( $lang_file, 'w') ) + { + fwrite($fh, $start, strlen($start) ); + fclose($fh); + } + else + { + $ADMIN->error("Could not write back to $lang_file"); + } + + $ADMIN->done_screen("Set updated", "Manage Language Sets", "act=lang" ); + + + + } + + //------------------------------------------------------------- + // EDIT SPLASH + //------------------------------------------------------------- + + function do_form( $method='add', $id="" ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + if ($id != "") + { + $IN['id'] = $id; + } + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing language set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_languages WHERE lid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $lang_dir = $INFO['base_dir']."lang/".$row['ldir']; + + $form_array = array(); + + if ($method != 'add') + { + if ( ! is_writeable($lang_dir) ) + { + $ADMIN->error("Cannot write into '$lang_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + } + + //+------------------------------- + + if ( is_dir($lang_dir) ) + { + $handle = opendir($lang_dir); + + while (($filename = readdir($handle)) !== false) + { + if (($filename != ".") && ($filename != "..")) + { + if (preg_match("/^index/", $filename)) + { + continue; + } + + if (preg_match("/\.php$/", $filename)) + { + $form_array[] = array( $filename, preg_replace( "/\.php$/", "", $filename ) ); + } + } + } + + closedir($handle); + } + + if ($row['lauthor'] and $row['lemail']) + { + $author = "

    This language set '{$row['lname']}' was created by {$row['lauthor']}"; + } + else if ($row['lauthor']) + { + $author = "

    This language set '{$row['lname']}' was created by {$row['lauthor']}"; + } + + //+------------------------------- + + $ADMIN->page_detail = "Please choose which language section you wish to edit below.$author $url"; + $ADMIN->page_title = "Edit Language set"; + + //+------------------------------- + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'editinfo' ), + 2 => array( 'act' , 'lang' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "60%" ); + $SKIN->td_header[] = array( " " , "40%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Edit language set information" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( + "Language Set Name", + $SKIN->form_input('lname', $row['lname']), + ) ); + + if ($method == 'add') + { + + $ADMIN->html .= $SKIN->add_td_row( array( + "Language set author name:", + $SKIN->form_input('lauthor', $row['lauthor']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Language set author email:", + $SKIN->form_input('lemail', $row['lemail']), + ) ); + + } + + $ADMIN->html .= $SKIN->end_form("Edit language set details"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'edit2' ), + 2 => array( 'act' , 'lang' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "60%" ); + $SKIN->td_header[] = array( " " , "40%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Edit language files in set '".$row['lname']."'" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Please select a language file to edit", + $SKIN->form_dropdown('lang_file', $form_array), + ) ); + + $ADMIN->html .= $SKIN->end_form("Edit this language file"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // SHOW ALL LANGUAGE PACKS + //------------------------------------------------------------- + + function list_current() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($INFO['default_language'] == "") + { + $INFO['default_language'] = 'en'; + } + + $form_array = array(); + + $ADMIN->page_detail = "You can edit, remove and create new language packs from this section"; + $ADMIN->page_title = "Manage Language Sets"; + + //+------------------------------- + + $DB->query("select ibf_languages.*, count(ibf_members.id) as mcount from ibf_languages left join ibf_members on(ibf_members.language=ibf_languages.ldir) where (ibf_members.language is not null or ibf_members.language = 'en') group by ibf_languages.ldir order by ibf_languages.lname"); + + + $used_ids = array(); + $show_array = array(); + + if ( $DB->get_num_rows() ) + { + + $SKIN->td_header[] = array( "Title" , "40%" ); + $SKIN->td_header[] = array( "Members" , "30%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Current Language Packs In Use" ); + + while ( $r = $DB->fetch_row() ) + { + + if ($INFO['default_language'] == $r['ldir']) + { + $root = " (Default Language)"; + } + else + { + $root = " ( Make Default Language )"; + } + + $show_array[ $r['lid'] ] .= stripslashes($r['lname'])."
    "; + + if ( in_array( $r['lid'], $used_ids ) ) + { + continue; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['lname'])." $root", + "
    {$r['mcount']}
    ", + "
    Export
    ", + "
    Edit
    ", + "Deallocate before removing", + ) ); + + $used_ids[] = $r['lid']; + + $form_array[] = array( $r['lid'], $r['lname'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + + if ( count($used_ids) < 1 ) + { + $used_ids[] = '0'; + } + $DB->query("SELECT lid, ldir, lname FROM ibf_languages WHERE lid NOT IN(".implode(",",$used_ids).")"); + + if ( $DB->get_num_rows() ) + { + + $SKIN->td_header[] = array( "Title" , "40%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "30%" ); + $SKIN->td_header[] = array( "Remove" , "20%" ); + + $ADMIN->html .= $SKIN->start_table( "Current Unallocated Language Packs" ); + + $ADMIN->html .= $SKIN->js_checkdelete(); + + while ( $r = $DB->fetch_row() ) + { + + if ($INFO['default_language'] == $r['ldir']) + { + $root = " (Default Language)"; + } + else + { + $root = " ( Make Default Language )"; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['lname'])." $root", + "
    Export
    ", + "
    Edit
    ", + "
    Remove
    ", + ) ); + + $form_array[] = array( $r['lid'], $r['lname'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + //} + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'lang' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Create Language Set" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Base new language set on..." , + $SKIN->form_dropdown( "id", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Create new Language set"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_member.php b/upload/sources/Admin/ad_member.php index 26ffbb0b..d1d2575c 100644 --- a/upload/sources/Admin/ad_member.php +++ b/upload/sources/Admin/ad_member.php @@ -1,1583 +1,2423 @@ - Admin Forum functions -| > Module written by Matt Mecham -| > Date started: 1st march 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new ad_forums(); - - -class ad_forums { - - var $base_url; - - function ad_forums() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; - - switch($IN['code']) - { - case 'stepone': - $this->step_one(); - break; - case 'doform': - $this->do_edit_form(); - break; - case 'doedit': - $this->do_edit(); - break; - //--------------------- - case 'add': - $this->add_form(); - break; - case 'doadd': - $this->do_add(); - break; - //--------------------- - case 'del': - $this->delete_form(); - break; - case 'delete2': - $this->delete_lookup_form(); - break; - case 'dodelete': - $this->dodelete(); - break; - case 'prune': - $this->prune_confirm(); - break; - case 'doprune': - $this->doprune(); - break; - //--------------------- - case 'title': - $this->titles(); - break; - case 'rank_edit': - $this->rank_setup('edit'); - break; - case 'rank_add': - $this->rank_setup('add'); - break; - case 'do_add_rank': - $this->add_rank(); - break; - case 'do_rank_edit': - $this->edit_rank(); - break; - case 'rank_delete': - $this->delete_rank(); - break; - //--------------------- - case 'ban': - $this->ban_control(); - break; - case 'doban': - $this->update_ban(); - break; - //--------------------- - case 'mod': - $this->view_mod(); - break; - case 'domod': - $this->domod(); - break; - //--------------------- - default: - $this->search_form(); - break; - } - - } - - - - //+--------------------------------------------------------------------------------- - // - // Moderation control... - // - //+--------------------------------------------------------------------------------- - - function domod() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ids = array(); - - foreach ($IN as $k => $v) - { - if ( preg_match( "/^mid_(\d+)$/", $k, $match ) ) - { - if ($IN[ $match[0] ]) - { - $ids[] = $match[1]; - } - } - } - - //------------------- - - if ( count($ids) < 1 ) - { - $ADMIN->error("You did not select any members to approve or delete"); - } - - - - //------------------- - - if ($IN['type'] == 'approve') - { - - //------------------------------------------- - - require $root_path."sources/lib/emailer.php"; - - $email = new emailer(); - - $email->get_template("complete_reg"); - - $email->build_message( "" ); - - $email->subject = "Account validated at ".$INFO['board_name']; - - //------------------------------------------- - - $main = $DB->query("SELECT id, email, validate_key, mgroup, prev_group FROM ibf_members WHERE id IN(".implode( ",",$ids ).")"); - - while( $row = $DB->fetch_row( $main ) ) - { - if ($row['mgroup'] != $INFO['auth_group']) - { - continue; - } - - if ($row['prev_group'] == "") - { - $row['prev_group'] = $INFO['member_group']; - } - - $update = $DB->query("UPDATE ibf_members SET prev_group='', validate_key='', mgroup='".$row['prev_group']."' WHERE id='".$row['id']."'"); - - $email->to = $row['email']; - - $email->send_mail(); - } - - $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY id DESC LIMIT 0,1"); - $r = $DB->fetch_row(); - - $DB->query("UPDATE ibf_stats SET MEM_COUNT=MEM_COUNT+".count($ids).", LAST_MEM_NAME='{$r['name']}', LAST_MEM_ID='{$r['id']}'"); - - - $ADMIN->done_screen( count($ids)." Members Approved", "Manage Registrations", "act=mem&code=mod" ); - - } - else - { - $DB->query("DELETE FROM ibf_members WHERE id IN(".implode( ",",$ids ).")"); - - $DB->query("UPDATE ibf_stats SET MEM_COUNT=MEM_COUNT-".count($ids)); - - $ADMIN->done_screen( count($ids)." Members Removed", "Manage Registrations", "act=mem&code=mod" ); - } - - } - - - //--------------------------------------------- - - function view_mod() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Manage User Registration/Email Change Queues"; - - $ADMIN->page_detail = "This section allows you to allow or deny registrations where you have requested that an administrator previews new accounts before allowing full membership. It will also allow you to complete or deny new email address changes.

    This form will also allow you to complete the registrations for those who did not receive an email."; - - $DB->query("SELECT COUNT(id) as mcount FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' and (new_pass = '' or new_pass is null)"); - - $row = $DB->fetch_row(); - - $cnt = $row['mcount'] < 1 ? 0 : $row['mcount']; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'domod' ), - 2 => array( 'act' , 'mem' ), - ) ); - - $SKIN->td_header[] = array( "Member Name" , "30%" ); - $SKIN->td_header[] = array( "Email Address" , "30%" ); - $SKIN->td_header[] = array( "Posts" , "10%" ); - $SKIN->td_header[] = array( "Registered On" , "20%" ); - $SKIN->td_header[] = array( "Select" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Users awaiting authorisation" ); - - $ADMIN->html .= $SKIN->add_td_basic( "$cnt users require registration or email change validation, showing 0 - 75", "center", "title"); - - if ($cnt > 0) - { - $DB->query("SELECT name, id, email, posts, joined FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' and (new_pass = '' or new_pass is null) ORDER BY joined DESC LIMIT 0,75"); - - while ( $r = $DB->fetch_row() ) - { - $ADMIN->html .= $SKIN->add_td_row( array( "".$r['name']."" , - $r['email'], - "
    {$r['posts']}
    ", - $std->get_date( $r['joined'], 'JOINED' ), - "" - ) ); - } - - $ADMIN->html .= $SKIN->add_td_basic("", "center", "row1" ); - - } - - $ADMIN->html .= $SKIN->end_form("Go!"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - - - //+--------------------------------------------------------------------------------- - // - // Ban control... - // - //+--------------------------------------------------------------------------------- - - function ban_control() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Ban Control"; - - $ADMIN->page_detail = "This section allows you to modify, delete or add IP addresses, email addresses and reserved names to the ban filters."; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doban' ), - 2 => array( 'act' , 'mem' ), - ) ); - - $ip_list = ""; - $name_list = ""; - $email_list = ""; - - if ($INFO['ban_ip'] != "") - { - $ip_list = preg_replace( "/\|/", "\n", $INFO['ban_ip'] ); - } - - //+------------------------------- - - if ($INFO['ban_email'] != "") - { - $email_list = preg_replace( "/\|/", "\n", $INFO['ban_email'] ); - } - - //+------------------------------- - - if ($INFO['ban_names'] != "") - { - $name_list = preg_replace( "/\|/", "\n", $INFO['ban_names'] ); - } - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Ban Control" ); - - $ADMIN->html .= $SKIN->add_td_basic("Banned IP Addresses (one per line - use * as a wildcard)", "center", "title"); - - $ADMIN->html .= $SKIN->add_td_row( array( "Banned IP Address
    (Example: 212.45.45.23)
    (Example: 212.45.45.*)" , - $SKIN->form_textarea( 'ban_ip', $ip_list ) - ) ); - - $ADMIN->html .= $SKIN->add_td_basic("Banned Email Addresses (one per line - use * as a wildcard)", "center", "title"); - - $ADMIN->html .= $SKIN->add_td_row( array( "Banned Email Address
    (Example: name@domain.com)
    (Example: *@domain.com)" , - $SKIN->form_textarea( 'ban_email', $email_list ) - ) ); - - $ADMIN->html .= $SKIN->add_td_basic("Banned / Reserved Names (one per line)", "center", "title"); - - $ADMIN->html .= $SKIN->add_td_row( array( "Banned Names" , - $SKIN->form_textarea( 'ban_names', $name_list ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Update the ban filters"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - function update_ban() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - // Get the incoming.. - - $new = array(); - - $new['ban_ip'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_ip']) ); - $new['ban_email'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_email']) ); - $new['ban_names'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_names']) ); - - $ADMIN->rebuild_config( $new ); - - $ADMIN->done_screen("Ban Filters Updated", "Ban Control", "act=mem&code=ban" ); - - } - - - - //+--------------------------------------------------------------------------------- - // - // MEMBER RANKS... - // - //+--------------------------------------------------------------------------------- - - function titles() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Member Ranking Set Up"; - - $ADMIN->page_detail = "This section allows you to modify, delete or add extra ranks.
    If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'html/team_icons' directory of your installation"; - - - //+------------------------------- - - $SKIN->td_header[] = array( "Title" , "30%" ); - $SKIN->td_header[] = array( "Min Posts" , "10%" ); - $SKIN->td_header[] = array( "Pips" , "20%" ); - $SKIN->td_header[] = array( " " , "20%" ); - $SKIN->td_header[] = array( " " , "20%" ); - - //+------------------------------- - - $DB->query("SELECT s.*, i.*, t.template FROM ibf_templates t, ibf_skins s, ibf_images i ". - "WHERE s.default_set=1 AND t.tmid=s.tmpl_id AND i.imid=s.img_id"); - - $row = $DB->fetch_row(); - - $ADMIN->html .= $SKIN->start_table( "Member Titles/Ranks" ); - - $DB->query("SELECT * FROM ibf_titles ORDER BY posts"); - - while ( $r = $DB->fetch_row() ) - { - $img = ""; - - if ( preg_match( "/^\d+$/", $r['pips'] ) ) - { - for ($i = 1; $i <= $r['pips']; $i++) - { - $img .= $row['A_STAR']; - - } - } - else - { - $img = ""; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "".$r['title']."" , - $r['posts'], - $img, - "Edit", - "Delete", - ) ); - - } - - - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'do_add_rank' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Add a Member Rank" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Rank Title" , - $SKIN->form_input( "title" ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Minimum number of posts needed" , - $SKIN->form_input( "posts" ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of pips
    (Or pip image)" , - $SKIN->form_input( "pips" ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Add this rank"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - } - - //+--------------------------------------------------------------------------------- - - function add_rank() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - // check for input - //+------------------------------- - - foreach( array( 'posts', 'title', 'pips' ) as $field ) - { - if ($IN[ $field ] == "") - { - $ADMIN->error("You must complete the form fully"); - } - } - - //+------------------------------- - // Add it to the DB - //+------------------------------- - - $db_string = $DB->compile_db_insert_string( array ( - 'posts' => trim($IN['posts']), - 'title' => trim($IN['title']), - 'pips' => trim($IN['pips']), - ) ); - - $DB->query("INSERT INTO ibf_titles (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - $ADMIN->done_screen("Rank Added", "Member Ranking Control", "act=mem&code=title" ); - - - } - - //+--------------------------------------------------------------------------------- - - function delete_rank() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - // check for input - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("We could not match that ID"); - } - - $DB->query("DELETE FROM ibf_titles WHERE id='".$IN['id']."'"); - - $ADMIN->done_screen("Rank Removed", "Member Ranking Control", "act=mem&code=title" ); - - } - - //+--------------------------------------------------------------------------------- - - function edit_rank() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - // check for input - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("We could not match that ID"); - } - - //+------------------------------- - - foreach( array( 'posts', 'title', 'pips' ) as $field ) - { - if ($IN[ $field ] == "") - { - $ADMIN->error("You must complete the form fully"); - } - } - - //+------------------------------- - // Add it to the DB - //+------------------------------- - - $db_string = $DB->compile_db_update_string( array ( - 'posts' => trim($IN['posts']), - 'title' => trim($IN['title']), - 'pips' => trim($IN['pips']), - ) ); - - $DB->query("UPDATE ibf_titles SET $db_string WHERE id='".$IN['id']."'"); - - $ADMIN->done_screen("Rank Edited", "Member Ranking Control", "act=mem&code=title" ); - - - } - - //+--------------------------------------------------------------------------------- - - function rank_setup($mode='edit') { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Member Rank Set Up"; - - $ADMIN->page_detail = "If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'html/team_icons' directory of your installation"; - - if ($mode == 'edit') - { - $form_code = 'do_rank_edit'; - - if ($IN['id'] == "") - { - $ADMIN->error("No rank ID was set, please try again"); - } - - $DB->query("SELECT * from ibf_titles WHERE id='".$IN['id']."'"); - $rank = $DB->fetch_row(); - - $button = "Complete Edit"; - } - else - { - $form_code = 'do_add_rank'; - $rank = array( 'posts' => "", 'title' => "", 'pips' => ""); - $button = "Add this rank"; - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), - 2 => array( 'act' , 'mem' ), - 3 => array( 'id' , $rank['id'] ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Ranks" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Rank Title" , - $SKIN->form_input( "title", $rank['title'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Minimum number of posts needed" , - $SKIN->form_input( "posts", $rank['posts'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of pips
    (Or pip image)" , - $SKIN->form_input( "pips", $rank['pips'] ) - ) ); - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - //+--------------------------------------------------------------------------------- - - - //+--------------------------------------------------------------------------------- - // - // DELETE MEMBER SET UP - // - //+--------------------------------------------------------------------------------- - - function delete_form() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Member Account Deletion"; - - $ADMIN->page_detail = "Search for a member to delete by enter part or all of the username, or configure the prune form."; - - - $mem_group[0] = array( '0', 'Any member group' ); - - $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); - - while ( $r = $DB->fetch_row() ) - { - $mem_group[] = array( $r['g_id'] , $r['g_title'] ); - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'delete2' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Lookup" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , - $SKIN->form_input( "USER_NAME" ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Find Member Account"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'prune' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "or remove members where..." ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "The members last post was over [x] days ago.
    ([x] = number entered)
    (Leave blank to omit from query)" , - $SKIN->form_input( "last_post", '60') - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "and where the member has less than [x] posts
    ([x] = number entered)
    (Leave blank to omit from query)" , - $SKIN->form_input( "posts", '100') - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "and where the member joined [x] days ago
    ([x] = number entered)
    (Leave blank to omit from query)" , - $SKIN->form_input( "joined", '365') - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "and the member group is..." , - $SKIN->form_dropdown( "mgroup", - $mem_group, - 0 - ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Prune members"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - //+--------------------------------------------------------------------------------- - - function prune_confirm() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //----------------------------- - // Make sure we have *something* - //------------------------------ - - $blanks = 0; - - foreach( array( 'posts', 'last_post', 'joined' ) as $field ) - { - if ($IN[ $field ] == "") - { - $blanks++; - } - } - - if ($blanks == 3) - { - $ADMIN->error("You must specify at least one field to use in the pruning query"); - } - - $time_now = time(); - - $query = "SELECT COUNT(id) as mcount FROM ibf_members WHERE"; - - $add_query = array(); - - if ($IN['joined'] > 0) - { - $j = $time_now - ($IN['joined'] *60*60*24); - $add_query[] = " joined < $j "; - } - - if ($IN['last_post'] > 0) - { - $l = $time_now - ($IN['last_post'] *60*60*24); - $add_query[] = " last_post < $l "; - } - - if ($IN['posts'] > 0) - { - $add_query[] = " posts < ".$IN['posts']." "; - } - - if ($IN['mgroup'] > 0) - { - $add_query[] = " mgroup='".$IN['mgroup']."' "; - } - - $add_query[] = ' id > 0'; - - $additional_query = implode( "AND", $add_query ); - - $this_query = trim( $query.$additional_query ); - - $pass_query = addslashes(urlencode($additional_query)); - - //-------------------------------- - // Run the query - //-------------------------------- - - $DB->query($this_query); - - $count = $DB->fetch_row(); - - if ($count['mcount'] < 1) - { - $ADMIN->error("We did not find any members matching the prune criteria. Please go back and try again"); - } - - $ADMIN->page_title = "Member Pruning"; - - $ADMIN->page_detail = "Please confirm your action."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doprune' ), - 2 => array( 'act' , 'mem' ), - 3 => array( 'query' , $pass_query ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Prune Confirmation" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of members to prune" , - $count['mcount'] - ) ); - - $ADMIN->html .= $SKIN->end_form("Complete Member Pruning"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - - //+--------------------------------------------------------------------------------- - - - function doprune() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //----------------------------- - // Make sure we have *something* - //------------------------------ - - $query = trim(urldecode(stripslashes($IN['query']))); - - if ($query == "") - { - $ADMIN->error("Prune query error, no query to use"); - } - - //----------------------------- - // Get the member ids... - //------------------------------ - - $ids = array(); - - $DB->query("SELECT id FROM ibf_members WHERE ".$query); - - if ( $DB->get_num_rows() ) - { - while ($i = $DB->fetch_row()) - { - $ids[] = $i['id']; - } - } - else - { - $ADMIN->error("Could not find any members that matched the prune criteria"); - } - - $id_string = implode( "," , $ids ); - - $id_count = count($ids); - - // Convert their posts and topics into guest postings.. - - $DB->query("UPDATE ibf_posts SET author_id='0' WHERE author_id IN(".$id_string.")"); - - $DB->query("UPDATE ibf_topics SET starter_id='0' WHERE starter_id IN(".$id_string.")"); - - // Delete member... - - $DB->query("DELETE from ibf_members WHERE id IN(".$id_string.")"); - - // Delete member messages... - - $DB->query("DELETE from ibf_messages WHERE member_id IN (".$id_string.")"); - - // Delete member subscriptions. - - $DB->query("DELETE from ibf_tracker WHERE member_id IN (".$id_string.")"); - - // Set the stats DB straight. - - $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY joined DESC LIMIT 0,1"); - - $mem = $DB->fetch_row(); - - $DB->query("UPDATE ibf_stats SET ". - "MEM_COUNT=MEM_COUNT-".$id_count.", ". - "LAST_MEM_NAME='" . $mem['name'] . "', ". - "LAST_MEM_ID='" . $mem['id'] . "'"); - - // Blow me melon farmer - - $ADMIN->done_screen("Member Account(s) Deleted", "Member Control", "act=mem&code=edit" ); - - } - - //+--------------------------------------------------------------------------------- - - function delete_lookup_form() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['USER_NAME'] == "") - { - $ADMIN->error("You didn't choose a member name to look for!"); - } - - $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'"); - - if (! $DB->get_num_rows() ) - { - $ADMIN->error("Sorry, we could not find any members that matched the search string you entered"); - } - - $form_array = array(); - - while ( $r = $DB->fetch_row() ) - { - $form_array[] = array( $r['id'] , $r['name'] ); - } - - - - $ADMIN->page_title = "Delete a member"; - - $ADMIN->page_detail = "Please choose which member to delete."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dodelete' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Lookup results" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Choose from the matches..." , - $SKIN->form_dropdown( "MEMBER_ID", $form_array ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Delete Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - } - - //+--------------------------------------------------------------------------------- - - //+--------------------------------------------------------------------------------- - // - // DO DELETE - // - //+--------------------------------------------------------------------------------- - - function dodelete() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['MEMBER_ID'] == "") - { - $ADMIN->error("Could not resolve member id"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); - $mem = $DB->fetch_row(); - - //+------------------------------- - - if ($mem['id'] == "") - { - $ADMIN->error("Could not resolve member id"); - } - - // Convert their posts and topics into guest postings.. - - $DB->query("UPDATE ibf_posts SET author_id='0' WHERE author_id='".$IN['MEMBER_ID']."'"); - - $DB->query("UPDATE ibf_topics SET starter_id='0' WHERE starter_id='".$IN['MEMBER_ID']."'"); - - // Delete member... - - $DB->query("DELETE from ibf_members WHERE id='".$IN['MEMBER_ID']."'"); - - // Delete member messages... - - $DB->query("DELETE from ibf_messages WHERE member_id='".$IN['MEMBER_ID']."'"); - - // Delete member subscriptions. - - $DB->query("DELETE from ibf_tracker WHERE member_id='".$IN['MEMBER_ID']."'"); - - // Set the stats DB straight. - - $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY joined DESC LIMIT 0,1"); - - $mem = $DB->fetch_row(); - - $DB->query("UPDATE ibf_stats SET ". - "MEM_COUNT=MEM_COUNT-1, ". - "LAST_MEM_NAME='" . $mem['name'] . "', ". - "LAST_MEM_ID='" . $mem['id'] . "'"); - - // Blow me melon farmer - - $ADMIN->done_screen("Member Account Deleted", "Member Control", "act=mem&code=edit" ); - - } - - //+------------------------------- - //+--------------------------------------------------------------------------------- - // - // ADD MEMBER FORM - // - //+--------------------------------------------------------------------------------- - - function add_form() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Pre Register a member"; - - $ADMIN->page_detail = "You may pre-register members using this form."; - - $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); - - while ( $r = $DB->fetch_row() ) - { - $mem_group[] = array( $r['g_id'] , $r['g_title'] ); - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doadd' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Registration" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Member Name" , - $SKIN->form_input( "name" ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Password" , - $SKIN->form_input( "password", "", 'password' ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Email Address" , - $SKIN->form_input( "email" ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Member Group" , - $SKIN->form_dropdown( "mgroup", - $mem_group, - $mem['mgroup'] - ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Register Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - function do_add() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - foreach( array('name', 'password', 'email', 'mgroup') as $field ) - { - if ($IN[ $field ] == "") - { - $ADMIN->error("You must complete the form fully!"); - } - } - - //---------------------------------- - // Do we already have such a member? - //---------------------------------- - - $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'"); - - if ( $DB->get_num_rows() ) - { - $ADMIN->error("We already have a member by that name, please select another"); - } - - //+-------------------------------------------- - //| Find the highest member id, and increment it - //| auto_increment not used for guest id 0 val. - //+-------------------------------------------- - - $DB->query("SELECT MAX(id) as new_id FROM ibf_members"); - $r = $DB->fetch_row(); - - $member_id = $r['new_id'] + 1; - - $db_string = $DB->compile_db_insert_string( array ( - 'id' => $member_id, - 'name' => trim($IN['name']), - 'password' => md5(trim($IN['password'])), - 'email' => trim(strtolower($IN['email'])), - 'mgroup' => $IN['mgroup'], - 'joined' => time(), - 'posts' => 0, - 'ip_address' => $IN['ip_address'], - 'time_offset' => 0, - 'view_sigs' => 1, - 'view_avs' => 1, - 'allow_post' => 1, - 'view_pop' => 1, - 'view_img' => 1, - 'vdirs' => "in:Inbox|sent:Sent Items", - ) ); - - $DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - $member_id = $DB->get_insert_id(); - - $DB->query("UPDATE ibf_stats SET ". - "MEM_COUNT=MEM_COUNT+1, ". - "LAST_MEM_NAME='" . trim($IN['name']) . "', ". - "LAST_MEM_ID='" . $member_id . "'"); - - $ADMIN->done_screen("Member Account Created", "Member Control", "act=mem&code=edit" ); - - } - - - //+--------------------------------------------------------------------------------- - // - // SEARCH FORM, SEARCH FOR MEMBER - // - //+--------------------------------------------------------------------------------- - - function search_form() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Edit a member"; - - $ADMIN->page_detail = "Search for a member."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'stepone' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Search for a member" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , - $SKIN->form_input( "USER_NAME" ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Find Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - //+--------------------------------------------------------------------------------- - - function step_one() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['USER_NAME'] == "") - { - $ADMIN->error("You didn't choose a member name to look for!"); - } - - $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'"); - - if (! $DB->get_num_rows() ) - { - $ADMIN->error("Sorry, we could not find any members that matched the search string you entered"); - } - - $form_array = array(); - - while ( $r = $DB->fetch_row() ) - { - $form_array[] = array( $r['id'] , $r['name'] ); - } - - - - $ADMIN->page_title = "Edit a member"; - - $ADMIN->page_detail = "Search for a member."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doform' ), - 2 => array( 'act' , 'mem' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Search for a member" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Choose from the matches..." , - $SKIN->form_dropdown( "MEMBER_ID", $form_array ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Edit Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - - - - } - - - //+--------------------------------------------------------------------------------- - // - // DO EDIT FORM - // - //+--------------------------------------------------------------------------------- - - function do_edit_form() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; - - require $root_path."sources/lib/post_parser.php"; - - $parser = new post_parser(); - - if ($IN['MEMBER_ID'] == "") - { - $ADMIN->error("Could not resolve member id"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); - $mem = $DB->fetch_row(); - - //+------------------------------- - - if ($mem['id'] == "") - { - $ADMIN->error("Could not resolve member id"); - } - - //+------------------------------- - - $mem_group = array(); - - $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); - - while ( $r = $DB->fetch_row() ) - { - $mem_group[] = array( $r['g_id'] , $r['g_title'] ); - } - - //+------------------------------- - - $lang_array = array(); - - $DB->query("SELECT ldir, lname FROM ibf_languages"); - - while ( $l = $DB->fetch_row() ) - { - $lang_array[] = array( $l['ldir'], $l['lname'] ); - } - - //+------------------------------- - - $DB->query("SELECT uid, sid, sname FROM ibf_skins"); - - $skin_array = array(); - - if ( $DB->get_num_rows() ) - { - while ( $s = $DB->fetch_row() ) - { - - $skin_array[] = array( $s['sid'], $s['sname'] ); - - } - } - - //+------------------------------- - //+------------------------------- - - - $ADMIN->page_title = "Edit member: ".$mem['name']." (ID: ".$mem['id'].")"; - - $ADMIN->page_detail = "You may alter the members settings from here."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), - 2 => array( 'act' , 'mem' ), - 3 => array( 'mid' , $mem['id'] ), - 4 => array( 'curpass', $mem['password'] ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Member Security Settings" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow {$mem['name']} to post where allowed?" , - $SKIN->form_yes_no("allow_post", $mem['allow_post'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Member Group" , - $SKIN->form_dropdown( "mgroup", - $mem_group, - $mem['mgroup'] - ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Member Title" , - $SKIN->form_input("title", $mem['title']) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Password Control" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "New Password
    (Leave this blank if you do not wish to reset password!)" , - $SKIN->form_input("password") - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+-------------------------------+ - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+-------------------------------+ - - $ADMIN->html .= $SKIN->start_table( "Board Settings" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Language Choice" , - $SKIN->form_dropdown( "language", - $lang_array, - $mem['language'] - ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Skin Choice" , - $SKIN->form_dropdown( "skin", - $skin_array, - $mem['skin'] - ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Hide this members email address?" , - $SKIN->form_yes_no("hide_email", $mem['hide_email'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Email a PM reminder?" , - $SKIN->form_yes_no("email_pm", $mem['email_pm'] ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+-------------------------------+ - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+-------------------------------+ - - $ADMIN->html .= $SKIN->start_table( "Contact Information" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Email Address" , - $SKIN->form_input("email", $mem['email']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "AIM Identity" , - $SKIN->form_input("aim_name", $mem['aim_name']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "ICQ Number" , - $SKIN->form_input("icq_number", $mem['icq_number']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Yahoo Identity" , - $SKIN->form_input("yahoo", $mem['yahoo']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "MSN Identity" , - $SKIN->form_input("msnname", $mem['msnname']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Website Address" , - $SKIN->form_input("website", $mem['website']) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+-------------------------------+ - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+-------------------------------+ - - $ADMIN->html .= $SKIN->start_table( "Other Information" ); - - //+------------------------------- - - $mem['signature'] = $parser->unconvert( $mem['signature'] ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Avatar" , - $SKIN->form_input("avatar", $mem['avatar']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Avatar Size" , - $SKIN->form_input("avatar_size", $mem['avatar_size']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Photo URL" , - $SKIN->form_input("photo", $mem['photo']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Post Count" , - $SKIN->form_input("posts", $mem['posts']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Location" , - $SKIN->form_input("location", $mem['location']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Interests" , - $SKIN->form_textarea("interests", $mem['interests']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Signature" , - $SKIN->form_textarea("signature", $mem['signature']) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+-------------------------------+ - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+-------------------------------+ - - $ADMIN->html .= $SKIN->start_table( "Validation Keys" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Validation Key
    (Do not alter unless you are sure it is no longer needed!)" , - $SKIN->form_input("validate_key", $mem['validate_key']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "New Password (MD5)
    (Do not alter unless you are sure it is no longer needed!)" , - $SKIN->form_input("new_pass", $mem['new_pass']) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Previous Member Group ID
    (Do not alter unless you are sure it is no longer needed!)" , - $SKIN->form_input("prev_group", $mem['prev_group']) - ) ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->end_form("Edit this member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - - //+--------------------------------------------------------------------------------- - - function do_edit() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; - - $password = ""; - - if ($IN['password'] != "") - { - $password = ", password='".md5($IN['password'])."'"; - } - - require $root_path."sources/lib/post_parser.php"; - - $parser = new post_parser(); - - $IN['signature'] = $parser->convert( array ('TEXT' => $IN['signature'], - 'SMILIES' => 0, - 'CODE' => $INFO['sig_allow_ibc'], - 'HTML' => $INFO['sig_allow_html'], - 'SIGNATURE' => 1 - ) ); - - $db_string = $DB->compile_db_update_string( array ( - 'allow_post' => $IN['allow_post'], - 'mgroup' => $IN['mgroup'], - 'title' => $IN['title'], - 'validate_key' => $IN['validate_key'], - 'new_pass' => $IN['new_pass'], - 'prev_group' => $IN['prev_group'], - 'language' => $IN['language'], - 'skin' => $IN['skin'], - 'hide_email' => $IN['hide_email'], - 'email_pm' => $IN['email_pm'], - 'email' => $IN['email'], - 'aim_name' => $IN['aim_name'], - 'icq_number' => $IN['icq_number'], - 'yahoo' => $IN['yahoo'], - 'msnname' => $IN['msnname'], - 'website' => $IN['website'], - 'avatar' => $IN['avatar'], - 'avatar_size' => $IN['avatar_size'], - 'photo' => $IN['photo'], - 'posts' => $IN['posts'], - 'location' => $IN['location'], - 'interests' => $IN['interests'], - 'signature' => $IN['signature'], - ) ); - - $DB->query("UPDATE ibf_members SET $db_string".$password." WHERE id='".$IN['mid']."'"); - - $ADMIN->done_screen("Member Edited", "Member Control", "act=mem&code=edit" ); - - } - - - - - -} - - + Admin Forum functions +| > Module written by Matt Mecham +| > Date started: 1st march 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new ad_forums(); + + +class ad_forums { + + var $base_url; + + function ad_forums() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; + + switch($IN['code']) + { + case 'stepone': + $this->do_advanced_search(1); + break; + case 'doform': + $this->do_edit_form(); + break; + case 'doedit': + $this->do_edit(); + break; + case 'advancedsearch': + $this->do_advanced_search(); + break; + //--------------------- + case 'add': + $this->add_form(); + break; + case 'doadd': + $this->do_add(); + break; + //--------------------- + case 'del': + $this->delete_form(); + break; + case 'delete2': + $this->delete_lookup_form(); + break; + case 'dodelete': + $this->dodelete(); + break; + case 'prune': + $this->prune_confirm(); + break; + case 'doprune': + $this->doprune(); + break; + //--------------------- + case 'title': + $this->titles(); + break; + case 'rank_edit': + $this->rank_setup('edit'); + break; + case 'rank_add': + $this->rank_setup('add'); + break; + case 'do_add_rank': + $this->add_rank(); + break; + case 'do_rank_edit': + $this->edit_rank(); + break; + case 'rank_delete': + $this->delete_rank(); + break; + //--------------------- + case 'ban': + $this->ban_control(); + break; + case 'doban': + $this->update_ban(); + break; + //--------------------- + case 'mod': + $this->view_mod(); + break; + case 'domod': + $this->domod(); + break; + //--------------------- + case 'changename': + $this->change_name_start(); + break; + case 'dochangename': + $this->change_name_complete(); + break; + //--------------------- + case 'mail': + $this->bulk_mail_form(); + break; + case 'domail': + $this->do_bulk_mail(); + break; + //--------------------- + default: + $this->search_form(); + break; + } + + } + + //+--------------------------------------------------------------------------------- + // + // MASS EMAIL PEOPLE! + // + //+--------------------------------------------------------------------------------- + + function do_bulk_mail() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + // Get the ID's of the groups we're emailing. + + $ids = array(); + + foreach ($IN as $key => $value) + { + if ( preg_match( "/^sg_(\d+)$/", $key, $match ) ) + { + if ($IN[$match[0]]) + { + $ids[] = $match[1]; + } + } + } + + if ( count($ids) < 1 ) + { + $this->bulk_mail_form(1, 'Errors', 'You must choose at least one group to send the email to'); + exit(); + } + + if ($IN['title'] == "") + { + $this->bulk_mail_form(1, 'Errors', 'You must set a subject for this email'); + exit(); + } + + if ($IN['email_contents'] == "") + { + $this->bulk_mail_form(1, 'Errors', 'You must include some text for the email body'); + exit(); + } + + $group_str = implode( ",", $ids); + + // Sort out the rest of the DB stuff + + $where = ""; // Where? who knows? who cares? + + if ($IN['posts'] > 0) + { + $where .= " AND posts < ".$IN['posts']; + } + + if ($IN['days'] > 0) + { + $time = time() - ($IN['days']*60*60*24); + $where .= " AND last_activity < '$time'"; + } + + if ($IN["honour_user_setting"] == 1) + { + $where .= "AND allow_admin_mails=1"; + } + + //+--------------------------------------- + // Get a grip, er count + //+--------------------------------------- + + $DB->query("SELECT COUNT(id) as total FROM ibf_members WHERE mgroup IN($group_str)".$where); + + $rows = $DB->fetch_row(); + + if ($rows['total'] < 1) + { + $this->bulk_mail_form(1, 'Errors', 'Please expand your criteria as no members could be found to email using the supplied information'); + exit(); + } + + //+--------------------------------------- + // Regex up stuff + //+--------------------------------------- + + $DB->query("SELECT * FROM ibf_stats"); + $stats = $DB->fetch_row(); + + $contents = stripslashes($HTTP_POST_VARS['email_contents']); + + $contents = str_replace( "{board_name}" , $INFO['board_name'] , $contents ); + $contents = str_replace( "{board_url}" , $INFO['board_url']."/index.".$INFO['php_ext'] , $contents ); + $contents = str_replace( "{reg_total}" , $stats['MEM_COUNT'] , $contents ); + $contents = str_replace( "{total_posts}", $stats['TOTAL_TOPICS'] + $stats['TOTAL_TOPICS'] , $contents ); + $contents = str_replace( "{busy_count}" , $stats['MOST_COUNT'] , $contents ); + $contents = str_replace( "{busy_time}" , $std->get_date( $stats['MOST_DATE'], 'SHORT' ), $contents ); + + + //+--------------------------------------- + // Are we previewing? Why am I asking you? + //+--------------------------------------- + + if ($IN['preview'] != "") + { + $this->bulk_mail_form(1, 'Preview', + "".stripslashes($HTTP_POST_VARS['title'])."

    " + .$contents."

    Members to mail: ".$rows['total'] + ); + exit(); + } + + //+--------------------------------------- + // We're still here? GROOVY, send da mail + //+--------------------------------------- + + @set_time_limit(1200); + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + $this->email->bcc = array(); + + $DB->query("SELECT email FROM ibf_members WHERE mgroup IN($group_str)".$where); + + while ( $r = $DB->fetch_row() ) + { + if ($r['email'] != "") + { + $this->email->bcc[] = $r['email']; + } + } + + $this->email->message = str_replace( "\r\n", "\n", $contents); + $this->email->subject = stripslashes($HTTP_POST_VARS['title']); + $this->email->to = ""; + $this->email->send_mail(); + + $ADMIN->save_log("Mass emailed members ($where)"); + + $ADMIN->done_screen("Bulk Email sent", "Member Control", "act=mem" ); + + } + + + + + function bulk_mail_form($preview=0, $title='Preview', $content="") { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + + $ADMIN->page_title = "Bulk Email Members"; + + $ADMIN->page_detail = "You may bulk email your members by configuring the form below. Click the 'Quick Help' link for more information"; + + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'domail' ), + 2 => array( 'act' , 'mem' ), + ) ); + + if ($HTTP_POST_VARS['email_contents'] == "") + { + $HTTP_POST_VARS['email_contents'] = "\n\n\n-------------------------------------\n{board_name} Statistics:\n" + ."-------------------------------------\nRegistered Users {reg_total}\nTotal Posts {total_posts}\n" + ."Busiest Time: {busy_count} users were online on {busy_time}\n\n" + ."-------------------------------------\nHandy Links\n" + ."-------------------------------------\nBoard Address: {board_url}\nLog In: {board_url}?act=Login&CODE=00\n" + ."Lost Password Recovery: {board_url}?act=Reg&CODE=10\n\n" + ."-------------------------------------\nHow to unsubscribe\n" + ."-------------------------------------\nVisit your email preferences ({board_url}?act=UserCP&CODE=02) and ensure " + ."that the box for 'Send me any updates sent by the board administrator' is unchecked and submit the form"; + } + + if ($preview == 1) + { + $SKIN->td_header[] = array( " " , "100%" ); + + $ADMIN->html .= $SKIN->start_table( $title ); + + $ADMIN->html .= $SKIN->add_td_row( array( nl2br($content) ) ); + + $ADMIN->html .= $SKIN->end_table(); + } + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Bulk Email Members: Content" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Honour 'Allow Admin Emails' user setting?
    It is strongly recommended that you do!" , + $SKIN->form_yes_no( "honour_user_setting", isset($IN["honour_user_setting"]) ? $IN["honour_user_setting"] : 1 ) + ) ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Email Subject" , + $SKIN->form_input( "title", stripslashes($HTTP_POST_VARS['title']) ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email contents
    ".$SKIN->js_help_link('m_bulkemail') , + $SKIN->form_textarea( "email_contents", stripslashes($HTTP_POST_VARS['email_contents']), 60, 15 ) + ) ); + + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Bulk Email Members: Settings" ); + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $ADMIN->html .= $SKIN->add_td_row( array( "Send to group {$r['g_title']}?" , + $SKIN->form_yes_no( "sg_{$r['g_id']}", isset($IN['sg_'.$r['g_id']]) ? $IN['sg_'.$r['g_id']] : 1 ) + ) ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Where user has less than [x] posts
    Leave blank to email regardless of post count" , + $SKIN->form_input( "post", $IN['post'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Where user has NOT been online for more than [x] days
    Leave blank to email regardless of last visit" , + $SKIN->form_input( "days", $IN['days'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_basic( '', 'center' ); + + $ADMIN->html .= $SKIN->end_form("Proceed"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + + //+--------------------------------------------------------------------------------- + // + // CHANGE MEMBER NAME + // + //+--------------------------------------------------------------------------------- + + function change_name_complete() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['mid'] == "") + { + $ADMIN->error("You must specify a valid member id, please go back and try again"); + } + + if ($IN['new_name'] == "") + { + $this->change_name_start("You must enter a new name for this member"); + exit(); + } + + $DB->query("SELECT name, email FROM ibf_members WHERE id='".$IN['mid']."'"); + + if ( ! $member = $DB->fetch_row() ) + { + $ADMIN->error("We could not match that ID in the members database"); + } + + $mid = $IN['mid']; // Save me poor ol' carpels + + if ($IN['new_name'] == $member['name']) + { + $this->change_name_start("The new name is the same as the old name, that is illogical captain"); + exit(); + } + + // Check to ensure that his member name hasn't already been taken. + + $new_name = trim($IN['new_name']); + + $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".strtolower($new_name)."'"); + + if ( $DB->get_num_rows() ) + { + $this->change_name_start("The name '$new_name' already exists, please choose another"); + exit(); + } + + // If one gets here, one can assume that the new name is correct for one, er...one. + // So, lets do the converteroo + + $DB->query("UPDATE ibf_members SET name='$new_name' WHERE id='$mid'"); + $DB->query("UPDATE ibf_contacts SET contact_name='$new_name' WHERE contact_id='$mid'"); + $DB->query("UPDATE ibf_forums SET last_poster_name='$new_name' WHERE last_poster_id='$mid'"); + $DB->query("UPDATE ibf_moderator_logs SET member_name='$new_name' WHERE member_id='$mid'"); + $DB->query("UPDATE ibf_moderators SET member_name='$new_name' WHERE member_id='$mid'"); + $DB->query("UPDATE ibf_posts SET author_name='$new_name' WHERE author_id='$mid'"); + $DB->query("UPDATE ibf_sessions SET member_name='$new_name' WHERE member_id='$mid'"); + $DB->query("UPDATE ibf_topics SET starter_name='$new_name' WHERE starter_id='$mid'"); + $DB->query("UPDATE ibf_topics SET last_poster_name='$new_name' WHERE last_poster_id='$mid'"); + + // I say, did we choose to email 'dis member? + + if ($IN['send_email'] == 1) + { + // By golly, we did! + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + $msg = trim($HTTP_POST_VARS['email_contents']); + + $msg = str_replace( "{old_name}", $member['name'], $msg ); + $msg = str_replace( "{new_name}", $new_name , $msg ); + + $this->email->message = $msg; + $this->email->subject = "Member Name Change Notification"; + $this->email->to = $member['email']; + $this->email->send_mail(); + } + + $ADMIN->save_log("Changed Member Name '{$member['name']}' to '$new_name'"); + + $ADMIN->done_screen("Member Name Changed", "Member Control", "act=mem" ); + } + + //=========================================================================== + + function change_name_start($message="") { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Change Member Name"; + + $ADMIN->page_detail = "You may enter a new name for this member."; + + if ($IN['mid'] == "") + { + $ADMIN->error("You must specify a valid member id, please go back and try again"); + } + + $DB->query("SELECT name FROM ibf_members WHERE id='".$IN['mid']."'"); + + if ( ! $member = $DB->fetch_row() ) + { + $ADMIN->error("We could not match that ID in the members database"); + } + + $contents = "{old_name},\nAn administrator has changed your member name on {$INFO['board_name']}.\n\nYour new name is: {new_name}\n\nPlease remember this as you will need to use this new name when you log in next time.\nBoard Address: {$INFO['board_url']}/index.php"; + + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dochangename' ), + 2 => array( 'act' , 'mem' ), + 3 => array( 'mid' , $IN['mid'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Change Member Name" ); + + if ($message != "") + { + $ADMIN->html .= $SKIN->add_td_row( array( "Error Message:" , + "$message", + ) ); + } + + + $ADMIN->html .= $SKIN->add_td_row( array( "Current Member's Name" , + $member['name'], + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "New Members Name" , + $SKIN->form_input( "new_name", $IN['new_name'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email notification to this member?
    (If so, you may edit the email below)" , + $SKIN->form_yes_no( "send_email", 1 ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email contents
    (Tags: {old_name} = current name, {new_name} = new name)" , + $SKIN->form_textarea( "email_contents", $contents ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Change this members name"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + } + + //+--------------------------------------------------------------------------------- + + + + //+--------------------------------------------------------------------------------- + // + // Moderation control... + // + //+--------------------------------------------------------------------------------- + + function domod() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ids = array(); + + foreach ($IN as $k => $v) + { + if ( preg_match( "/^mid_(\d+)$/", $k, $match ) ) + { + if ($IN[ $match[0] ]) + { + $ids[] = $match[1]; + } + } + } + + //------------------- + + if ( count($ids) < 1 ) + { + $ADMIN->error("You did not select any members to approve or delete"); + } + + + + //------------------- + + if ($IN['type'] == 'approve') + { + + //------------------------------------------- + + require $root_path."sources/lib/emailer.php"; + + $email = new emailer(); + + $email->get_template("complete_reg"); + + $email->build_message( "" ); + + $email->subject = "Account validated at ".$INFO['board_name']; + + //------------------------------------------- + + $main = $DB->query("SELECT id, email, validate_key, mgroup, prev_group FROM ibf_members WHERE id IN(".implode( ",",$ids ).")"); + + while( $row = $DB->fetch_row( $main ) ) + { + if ($row['mgroup'] != $INFO['auth_group']) + { + continue; + } + + if ($row['prev_group'] == "") + { + $row['prev_group'] = $INFO['member_group']; + } + + $update = $DB->query("UPDATE ibf_members SET prev_group='', validate_key='', mgroup='".$row['prev_group']."' WHERE id='".$row['id']."'"); + + $email->to = $row['email']; + + $email->send_mail(); + } + + $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY id DESC LIMIT 0,1"); + $r = $DB->fetch_row(); + + $DB->query("UPDATE ibf_stats SET MEM_COUNT=MEM_COUNT+".count($ids).", LAST_MEM_NAME='{$r['name']}', LAST_MEM_ID='{$r['id']}'"); + + $ADMIN->save_log("Approved Queued Registrations"); + + $ADMIN->done_screen( count($ids)." Members Approved", "Manage Registrations", "act=mem&code=mod" ); + + } + else + { + $DB->query("DELETE FROM ibf_members WHERE id IN(".implode( ",",$ids ).")"); + + //$DB->query("UPDATE ibf_stats SET MEM_COUNT=MEM_COUNT-".count($ids)); + + $ADMIN->save_log("Denied Queued Registrations"); + + $ADMIN->done_screen( count($ids)." Members Removed", "Manage Registrations", "act=mem&code=mod" ); + } + + } + + + //--------------------------------------------- + + function view_mod() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Manage User Registration/Email Change Queues"; + + $ADMIN->page_detail = "This section allows you to allow or deny registrations where you have requested that an administrator previews new accounts before allowing full membership. It will also allow you to complete or deny new email address changes.

    This form will also allow you to complete the registrations for those who did not receive an email."; + + $DB->query("SELECT COUNT(id) as mcount FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' and (new_pass = '' or new_pass is null)"); + + $row = $DB->fetch_row(); + + $cnt = $row['mcount'] < 1 ? 0 : $row['mcount']; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'domod' ), + 2 => array( 'act' , 'mem' ), + ) ); + + $SKIN->td_header[] = array( "Member Name" , "30%" ); + $SKIN->td_header[] = array( "Email Address" , "30%" ); + $SKIN->td_header[] = array( "Posts" , "10%" ); + $SKIN->td_header[] = array( "Registered On" , "20%" ); + $SKIN->td_header[] = array( "Select" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Users awaiting authorisation" ); + + $ADMIN->html .= $SKIN->add_td_basic( "$cnt users require registration or email change validation, showing 0 - 75", "center", "title"); + + if ($cnt > 0) + { + $DB->query("SELECT name, id, email, posts, joined, coppa_user FROM ibf_members WHERE mgroup='".$INFO['auth_group']."' and (new_pass = '' or new_pass is null) ORDER BY joined DESC LIMIT 0,75"); + + while ( $r = $DB->fetch_row() ) + { + + if ($r['coppa_user'] == 1) + { + $coppa = ' ( COPPA Request )'; + } + else + { + $coppa = ""; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".$r['name']."$coppa" , + $r['email'], + "
    {$r['posts']}
    ", + $std->get_date( $r['joined'], 'JOINED' ), + "" + ) ); + } + + $ADMIN->html .= $SKIN->add_td_basic("", "center", "row1" ); + + } + + $ADMIN->html .= $SKIN->end_form("Go!"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + + + //+--------------------------------------------------------------------------------- + // + // Ban control... + // + //+--------------------------------------------------------------------------------- + + function ban_control() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Ban Control"; + + $ADMIN->page_detail = "This section allows you to modify, delete or add IP addresses, email addresses and reserved names to the ban filters."; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doban' ), + 2 => array( 'act' , 'mem' ), + ) ); + + $ip_list = ""; + $name_list = ""; + $email_list = ""; + + if ($INFO['ban_ip'] != "") + { + $ip_list = preg_replace( "/\|/", "\n", $INFO['ban_ip'] ); + } + + //+------------------------------- + + if ($INFO['ban_email'] != "") + { + $email_list = preg_replace( "/\|/", "\n", $INFO['ban_email'] ); + } + + //+------------------------------- + + if ($INFO['ban_names'] != "") + { + $name_list = preg_replace( "/\|/", "\n", $INFO['ban_names'] ); + } + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Ban Control" ); + + $ADMIN->html .= $SKIN->add_td_basic("Banned IP Addresses (one per line - use * as a wildcard)", "center", "title"); + + $ADMIN->html .= $SKIN->add_td_row( array( "Banned IP Address
    (Example: 212.45.45.23)
    (Example: 212.45.45.*)" , + $SKIN->form_textarea( 'ban_ip', $ip_list ) + ) ); + + $ADMIN->html .= $SKIN->add_td_basic("Banned Email Addresses (one per line - use * as a wildcard)", "center", "title"); + + $ADMIN->html .= $SKIN->add_td_row( array( "Banned Email Address
    (Example: name@domain.com)
    (Example: *@domain.com)" , + $SKIN->form_textarea( 'ban_email', $email_list ) + ) ); + + $ADMIN->html .= $SKIN->add_td_basic("Banned / Reserved Names (one per line)", "center", "title"); + + $ADMIN->html .= $SKIN->add_td_row( array( "Banned Names" , + $SKIN->form_textarea( 'ban_names', $name_list ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Update the ban filters"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + function update_ban() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + // Get the incoming.. + + $new = array(); + + $new['ban_ip'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_ip']) ); + $new['ban_email'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_email']) ); + $new['ban_names'] = preg_replace( "/\n/", "|", trim($HTTP_POST_VARS['ban_names']) ); + + $ADMIN->rebuild_config( $new ); + + $ADMIN->save_log("Updated Ban Filters"); + + $ADMIN->done_screen("Ban Filters Updated", "Ban Control", "act=mem&code=ban" ); + + } + + + + //+--------------------------------------------------------------------------------- + // + // MEMBER RANKS... + // + //+--------------------------------------------------------------------------------- + + function titles() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Member Ranking Set Up"; + + $ADMIN->page_detail = "This section allows you to modify, delete or add extra ranks.
    If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'html/team_icons' directory of your installation"; + + + //+------------------------------- + + $SKIN->td_header[] = array( "Title" , "30%" ); + $SKIN->td_header[] = array( "Min Posts" , "10%" ); + $SKIN->td_header[] = array( "Pips" , "20%" ); + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "20%" ); + + //+------------------------------- + + $DB->query("SELECT macro_id, img_dir FROM ibf_skins WHERE default_set=1"); + + $mid = $DB->fetch_row(); + + $DB->query("SELECT macro_replace AS A_STAR FROM ibf_macro WHERE macro_set={$mid['macro_id']} AND macro_value='A_STAR'"); + + $row = $DB->fetch_row(); + + $row['A_STAR'] = str_replace( "<#IMG_DIR#>", $mid['img_dir'], $row['A_STAR'] ); + + $ADMIN->html .= $SKIN->start_table( "Member Titles/Ranks" ); + + $DB->query("SELECT * FROM ibf_titles ORDER BY posts"); + + while ( $r = $DB->fetch_row() ) + { + $img = ""; + + if ( preg_match( "/^\d+$/", $r['pips'] ) ) + { + for ($i = 1; $i <= $r['pips']; $i++) + { + $img .= $row['A_STAR']; + + } + } + else + { + $img = ""; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".$r['title']."" , + $r['posts'], + $img, + "Edit", + "Delete", + ) ); + + } + + + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'do_add_rank' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Add a Member Rank" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Rank Title" , + $SKIN->form_input( "title" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Minimum number of posts needed" , + $SKIN->form_input( "posts" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of pips
    (Or pip image)" , + $SKIN->form_input( "pips" ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Add this rank"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + } + + //+--------------------------------------------------------------------------------- + + function add_rank() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + // check for input + //+------------------------------- + + foreach( array( 'posts', 'title', 'pips' ) as $field ) + { + if ($IN[ $field ] == "") + { + $ADMIN->error("You must complete the form fully"); + } + } + + //+------------------------------- + // Add it to the DB + //+------------------------------- + + $db_string = $DB->compile_db_insert_string( array ( + 'posts' => trim($IN['posts']), + 'title' => trim($IN['title']), + 'pips' => trim($IN['pips']), + ) ); + + $DB->query("INSERT INTO ibf_titles (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + $ADMIN->done_screen("Rank Added", "Member Ranking Control", "act=mem&code=title" ); + + + } + + //+--------------------------------------------------------------------------------- + + function delete_rank() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + // check for input + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("We could not match that ID"); + } + + $DB->query("DELETE FROM ibf_titles WHERE id='".$IN['id']."'"); + + $ADMIN->save_log("Removed Rank Setting"); + + $ADMIN->done_screen("Rank Removed", "Member Ranking Control", "act=mem&code=title" ); + + } + + //+--------------------------------------------------------------------------------- + + function edit_rank() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + // check for input + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("We could not match that ID"); + } + + //+------------------------------- + + foreach( array( 'posts', 'title', 'pips' ) as $field ) + { + if ($IN[ $field ] == "") + { + $ADMIN->error("You must complete the form fully"); + } + } + + //+------------------------------- + // Add it to the DB + //+------------------------------- + + $db_string = $DB->compile_db_update_string( array ( + 'posts' => trim($IN['posts']), + 'title' => trim($IN['title']), + 'pips' => trim($IN['pips']), + ) ); + + $DB->query("UPDATE ibf_titles SET $db_string WHERE id='".$IN['id']."'"); + + $ADMIN->save_log("Edited Rank Setting"); + + $ADMIN->done_screen("Rank Edited", "Member Ranking Control", "act=mem&code=title" ); + + + } + + //+--------------------------------------------------------------------------------- + + function rank_setup($mode='edit') { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Member Rank Set Up"; + + $ADMIN->page_detail = "If you wish to display pips below the members name, enter the number of pips. If you wish to use a custom image, simply enter the image name in the pips box. Note, these custom images must reside in the 'html/team_icons' directory of your installation"; + + if ($mode == 'edit') + { + $form_code = 'do_rank_edit'; + + if ($IN['id'] == "") + { + $ADMIN->error("No rank ID was set, please try again"); + } + + $DB->query("SELECT * from ibf_titles WHERE id='".$IN['id']."'"); + $rank = $DB->fetch_row(); + + $button = "Complete Edit"; + } + else + { + $form_code = 'do_add_rank'; + $rank = array( 'posts' => "", 'title' => "", 'pips' => ""); + $button = "Add this rank"; + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), + 2 => array( 'act' , 'mem' ), + 3 => array( 'id' , $rank['id'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Ranks" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Rank Title" , + $SKIN->form_input( "title", $rank['title'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Minimum number of posts needed" , + $SKIN->form_input( "posts", $rank['posts'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of pips
    (Or pip image)" , + $SKIN->form_input( "pips", $rank['pips'] ) + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + + + //+--------------------------------------------------------------------------------- + // + // DELETE MEMBER SET UP + // + //+--------------------------------------------------------------------------------- + + function delete_form() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Member Account Deletion"; + + $ADMIN->page_detail = "Search for a member to delete by enter part or all of the username, or configure the prune form."; + + + $mem_group[0] = array( '0', 'Any member group' ); + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $mem_group[] = array( $r['g_id'] , $r['g_title'] ); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'delete2' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Lookup" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , + $SKIN->form_input( "USER_NAME" ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Find Member Account"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'prune' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "or remove members where..." ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "The members last post was over [x] days ago.
    ([x] = number entered)
    (Leave blank to omit from query)" , + $SKIN->form_input( "last_post", '60') + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "and where the member has less than [x] posts
    ([x] = number entered)
    (Leave blank to omit from query)" , + $SKIN->form_input( "posts", '100') + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "and where the member joined [x] days ago
    ([x] = number entered)
    (Leave blank to omit from query)" , + $SKIN->form_input( "joined", '365') + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "and the member group is..." , + $SKIN->form_dropdown( "mgroup", + $mem_group, + 0 + ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Prune members"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + + function prune_confirm() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //----------------------------- + // Make sure we have *something* + //------------------------------ + + $blanks = 0; + + foreach( array( 'posts', 'last_post', 'joined' ) as $field ) + { + if ($IN[ $field ] == "") + { + $blanks++; + } + } + + if ($blanks == 3) + { + $ADMIN->error("You must specify at least one field to use in the pruning query"); + } + + $time_now = time(); + + $query = "SELECT COUNT(id) as mcount FROM ibf_members WHERE"; + + $add_query = array(); + + if ($IN['joined'] > 0) + { + $j = $time_now - ($IN['joined'] *60*60*24); + $add_query[] = " joined < $j "; + } + + if ($IN['last_post'] > 0) + { + $l = $time_now - ($IN['last_post'] *60*60*24); + $add_query[] = " last_post < $l "; + } + + if ($IN['posts'] > 0) + { + $add_query[] = " posts < ".$IN['posts']." "; + } + + if ($IN['mgroup'] > 0) + { + $add_query[] = " mgroup='".$IN['mgroup']."' "; + } + + $add_query[] = ' id > 0'; + + $additional_query = implode( "AND", $add_query ); + + $this_query = trim( $query.$additional_query ); + + $pass_query = addslashes(urlencode($additional_query)); + + //-------------------------------- + // Run the query + //-------------------------------- + + $DB->query($this_query); + + $count = $DB->fetch_row(); + + if ($count['mcount'] < 1) + { + $ADMIN->error("We did not find any members matching the prune criteria. Please go back and try again"); + } + + $ADMIN->page_title = "Member Pruning"; + + $ADMIN->page_detail = "Please confirm your action."; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doprune' ), + 2 => array( 'act' , 'mem' ), + 3 => array( 'query' , $pass_query ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Prune Confirmation" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of members to prune" , + $count['mcount'] + ) ); + + $ADMIN->html .= $SKIN->end_form("Complete Member Pruning"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + + //+--------------------------------------------------------------------------------- + + + function doprune() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //----------------------------- + // Make sure we have *something* + //------------------------------ + + $query = trim(urldecode(stripslashes($IN['query']))); + + if ($query == "") + { + $ADMIN->error("Prune query error, no query to use"); + } + + //----------------------------- + // Get the member ids... + //------------------------------ + + $ids = array(); + + $DB->query("SELECT id FROM ibf_members WHERE ".$query); + + if ( $DB->get_num_rows() ) + { + while ($i = $DB->fetch_row()) + { + $ids[] = $i['id']; + } + } + else + { + $ADMIN->error("Could not find any members that matched the prune criteria"); + } + + $id_string = implode( "," , $ids ); + + $id_count = count($ids); + + // Convert their posts and topics into guest postings.. + + $DB->query("UPDATE ibf_posts SET author_id='0' WHERE author_id IN(".$id_string.")"); + + $DB->query("UPDATE ibf_topics SET starter_id='0' WHERE starter_id IN(".$id_string.")"); + + // Delete member... + + $DB->query("DELETE from ibf_members WHERE id IN(".$id_string.")"); + + $DB->query("DELETE from ibf_pfields_content WHERE member_id IN(".$id_string.")"); + + // Delete member messages... + + $DB->query("DELETE from ibf_messages WHERE member_id IN (".$id_string.")"); + + // Delete member subscriptions. + + $DB->query("DELETE from ibf_tracker WHERE member_id IN (".$id_string.")"); + + // Set the stats DB straight. + + $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY joined DESC LIMIT 0,1"); + + $mem = $DB->fetch_row(); + + $DB->query("UPDATE ibf_stats SET ". + "MEM_COUNT=MEM_COUNT-".$id_count.", ". + "LAST_MEM_NAME='" . $mem['name'] . "', ". + "LAST_MEM_ID='" . $mem['id'] . "'"); + + // Blow me melon farmer + + $ADMIN->save_log("Removed $id_count members via the prune form"); + + $ADMIN->done_screen("Member Account(s) Deleted", "Member Control", "act=mem&code=edit" ); + + } + + //+--------------------------------------------------------------------------------- + + function delete_lookup_form() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['USER_NAME'] == "") + { + $ADMIN->error("You didn't choose a member name to look for!"); + } + + $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'"); + + if (! $DB->get_num_rows() ) + { + $ADMIN->error("Sorry, we could not find any members that matched the search string you entered"); + } + + $form_array = array(); + + while ( $r = $DB->fetch_row() ) + { + $form_array[] = array( $r['id'] , $r['name'] ); + } + + + + $ADMIN->page_title = "Delete a member"; + + $ADMIN->page_detail = "Please choose which member to delete."; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dodelete' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Lookup results" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Choose from the matches..." , + $SKIN->form_dropdown( "MEMBER_ID", $form_array ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Delete Member"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + } + + //+--------------------------------------------------------------------------------- + + //+--------------------------------------------------------------------------------- + // + // DO DELETE + // + //+--------------------------------------------------------------------------------- + + function dodelete() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['MEMBER_ID'] == "") + { + $ADMIN->error("Could not resolve member id"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); + $mem = $DB->fetch_row(); + + //+------------------------------- + + if ($mem['id'] == "") + { + $ADMIN->error("Could not resolve member id"); + } + + // Convert their posts and topics into guest postings.. + + $DB->query("UPDATE ibf_posts SET author_id='0' WHERE author_id='".$IN['MEMBER_ID']."'"); + + $DB->query("UPDATE ibf_topics SET starter_id='0' WHERE starter_id='".$IN['MEMBER_ID']."'"); + + // Delete member... + + $DB->query("DELETE from ibf_members WHERE id='".$IN['MEMBER_ID']."'"); + + // Delete member messages... + + $DB->query("DELETE from ibf_messages WHERE member_id='".$IN['MEMBER_ID']."'"); + + // Delete member subscriptions. + + $DB->query("DELETE from ibf_tracker WHERE member_id='".$IN['MEMBER_ID']."'"); + + // Set the stats DB straight. + + $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY joined DESC LIMIT 0,1"); + + $mem = $DB->fetch_row(); + + $DB->query("UPDATE ibf_stats SET ". + "MEM_COUNT=MEM_COUNT-1, ". + "LAST_MEM_NAME='" . $mem['name'] . "', ". + "LAST_MEM_ID='" . $mem['id'] . "'"); + + // Blow me melon farmer + + $ADMIN->save_log("Deleted Member '{$mem['name']}'"); + + $ADMIN->done_screen("Member Account Deleted", "Member Control", "act=mem&code=edit" ); + + } + + //+------------------------------- + //+--------------------------------------------------------------------------------- + // + // ADD MEMBER FORM + // + //+--------------------------------------------------------------------------------- + + function add_form() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Pre Register a member"; + + $ADMIN->page_detail = "You may pre-register members using this form."; + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $mem_group[] = array( $r['g_id'] , $r['g_title'] ); + } + + //+------------------------------- + + $custom_output = ""; + $field_data = array(); + + $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$IN['MEMBER_ID']."'"); + + while ( $content = $DB->fetch_row() ) + { + foreach($content as $k => $v) + { + if ( preg_match( "/^field_(\d+)$/", $k, $match) ) + { + $field_data[ $match[1] ] = $v; + } + } + } + + $DB->query("SELECT * from ibf_pfields_data WHERE fshowreg=1 ORDER BY forder"); + + while( $row = $DB->fetch_row() ) + { + $form_element = ""; + + if ( $row['ftype'] == 'drop' ) + { + $carray = explode( '|', trim($row['fcontent']) ); + + $d_content = array(); + + foreach( $carray as $entry ) + { + $value = explode( '=', $entry ); + + $ov = trim($value[0]); + $td = trim($value[1]); + + if ($ov and $td) + { + $d_content[] = array( $ov, $td ); + } + } + + $form_element = $SKIN->form_dropdown( 'field_'.$row['fid'], $d_content, "" ); + + } + else if ( $row['ftype'] == 'area' ) + { + $form_element = $SKIN->form_textarea( 'field_'.$row['fid'], "" ); + } + else + { + $form_element = $SKIN->form_input( 'field_'.$row['fid'], "" ); + } + + $custom_out .= $SKIN->add_td_row( array( "{$row['ftitle']}
    {$row['desc']}" , $form_element ) ); + + } + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doadd' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Registration" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Member Name" , + $SKIN->form_input( "name" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Password" , + $SKIN->form_input( "password", "", 'password' ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email Address" , + $SKIN->form_input( "email" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Member Group" , + $SKIN->form_dropdown( "mgroup", + $mem_group, + $mem['mgroup'] + ) + ) ); + + if ($custom_out != "") + { + $ADMIN->html .= $custom_out; + } + + $ADMIN->html .= $SKIN->end_form("Register Member"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + function do_add() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + foreach( array('name', 'password', 'email', 'mgroup') as $field ) + { + if ($IN[ $field ] == "") + { + $ADMIN->error("You must complete the form fully!"); + } + } + + //---------------------------------- + // Do we already have such a member? + //---------------------------------- + + $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'"); + + if ( $DB->get_num_rows() ) + { + $ADMIN->error("We already have a member by that name, please select another"); + } + + //---------------------------------- + // Custom profile field stuff + //---------------------------------- + + $custom_fields = array(); + + $DB->query("SELECT * from ibf_pfields_data"); + + $have_custom = $DB->get_num_rows(); + + while ( $row = $DB->fetch_row() ) + { + $custom_fields[ 'field_'.$row['fid'] ] = $IN[ 'field_'.$row['fid'] ]; + } + + //+-------------------------------------------- + //| Find the highest member id, and increment it + //| auto_increment not used for guest id 0 val. + //+-------------------------------------------- + + $DB->query("SELECT MAX(id) as new_id FROM ibf_members"); + $r = $DB->fetch_row(); + + $member_id = $r['new_id'] + 1; + + $db_string = $DB->compile_db_insert_string( array ( + 'id' => $member_id, + 'name' => trim($IN['name']), + 'password' => md5(trim($IN['password'])), + 'email' => trim(strtolower($IN['email'])), + 'mgroup' => $IN['mgroup'], + 'joined' => time(), + 'posts' => 0, + 'ip_address' => $IN['ip_address'], + 'time_offset' => 0, + 'view_sigs' => 1, + 'view_avs' => 1, + 'allow_post' => 1, + 'view_pop' => 1, + 'view_img' => 1, + 'vdirs' => "in:Inbox|sent:Sent Items", + ) ); + + $DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + //$member_id = $DB->get_insert_id(); + + //+-------------------------------------------- + //| Insert into the custom profile fields DB + //+-------------------------------------------- + + if ( count($custom_fields) > 0 ) + { + + $custom_fields['member_id'] = $member_id; + + $db_string = $DB->compile_db_insert_string($custom_fields); + + $DB->query("INSERT INTO ibf_pfields_content (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + } + + unset($db_string); + + //+-------------------------------------------- + + $DB->query("UPDATE ibf_stats SET ". + "MEM_COUNT=MEM_COUNT+1, ". + "LAST_MEM_NAME='" . trim($IN['name']) . "', ". + "LAST_MEM_ID='" . $member_id . "'"); + + $ADMIN->save_log("Created new member account for '{$IN['name']}'"); + + $ADMIN->done_screen("Member Account Created", "Member Control", "act=mem&code=edit" ); + + } + + + //+--------------------------------------------------------------------------------- + // + // SEARCH FORM, SEARCH FOR MEMBER + // + //+--------------------------------------------------------------------------------- + + function search_form() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Edit a member"; + + $ADMIN->page_detail = "Search for a member."; + + $mem_group = array( 0 => array( 'all', 'Any Group') ); + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $mem_group[] = array( $r['g_id'] , $r['g_title'] ); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'stepone' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Quick Search" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , + $SKIN->form_input( "USER_NAME" ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Find Member"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'advancedsearch' ), + 2 => array( 'act' , 'mem' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Advanced Search", "Please complete at least one section, leave fields blank to omit from the query" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Member Name contains..." , + $SKIN->form_input( "name" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email Address contains..." , + $SKIN->form_input( "email" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "IP Address contains..." , + $SKIN->form_input( "ip_address" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "AIM name contains..." , + $SKIN->form_input( "aim_name" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "ICQ Number contains..." , + $SKIN->form_input( "icq_number" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Yahoo! Identity contains..." , + $SKIN->form_input( "yahoo" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Signature contains..." , + $SKIN->form_input( "signature" ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Last post from..." , + $SKIN->form_simple_input( "last_post" ). '... days ago to now' + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Last active from..." , + $SKIN->form_simple_input( "last_activity" ). '... days ago to now' + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Is in group..." , + $SKIN->form_dropdown( "mgroup", $mem_group ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Query Member Database"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + + function do_advanced_search($basic=0) { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $page_query = ""; + + if ($basic == 0) + { + $query = array(); + + foreach( array('name','email','ip_address','aim_name','icq_number','yahoo','signature','last_post','last_activity','mgroup') as $bit ) + { + $IN[ $bit ] = urldecode(trim($IN[ $bit ])); + + $page_query .= '&'.$bit.'='.urlencode($IN[ $bit ]); + + if ($IN[ $bit ] != "") + { + if ($bit == 'last_post' or $bit == 'last_activity') + { + $dateline = time() - ($IN[ $bit ]*60*60*24); + $query[] = 'm.'.$bit.' > '."'$dateline'"; + } + else if ($bit == 'mgroup') + { + if ($IN['mgroup'] != 'all') + { + $query[] = "m.mgroup=".$IN['mgroup']; + } + } + else + { + $query[] = 'm.'.$bit." LIKE '%".$IN[$bit]."%'"; + } + } + } + + if (count($query) < 1) + { + $ADMIN->error("Please complete at least one field before submitting the search form"); + } + + $rq = implode( " AND ", $query ); + } + else + { + // Basic username search + + $IN['USER_NAME'] = trim(urldecode($IN['USER_NAME'])); + + if ($IN['USER_NAME'] == "") + { + $ADMIN->error("You didn't choose a member name to look for!"); + } + + $page_query = "&USER_NAME=".urlencode($IN['USER_NAME']); + + $rq = "name LIKE '".$IN['USER_NAME']."%'"; + } + + $st = intval($IN['st']); + + if ($st < 1) + { + $st = 0; + } + + $query = "SELECT m.id, m.email, m.name, m.mgroup, m.ip_address, m.posts, g.g_title + FROM ibf_members m + LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) + WHERE $rq ORDER BY m.name LIMIT $st,50"; + + //+------------------------------- + // Get the number of results + //+------------------------------- + + $DB->query("SELECT COUNT(m.id) as count FROM ibf_members m WHERE $rq"); + + $count = $DB->fetch_row(); + + if ($count['count'] < 1) + { + $ADMIN->error("Your search query did not return any matches from the member database. Please go back and try again"); + } + + $ADMIN->page_title = "Your Member Search Results"; + + $ADMIN->page_detail = "Your search results."; + + //+------------------------------- + + $pages = $std->build_pagelinks( array( 'TOTAL_POSS' => $count['count'], + 'PER_PAGE' => 50, + 'CUR_ST_VAL' => $IN['st'], + 'L_SINGLE' => "Single Page", + 'L_MULTI' => "Multi Page", + 'BASE_URL' => $SKIN->base_url."&act=mem&code={$IN['code']}".$page_query, + ) + ); + + //+------------------------------- + + $SKIN->td_header[] = array( "Member Name" , "20%" ); + $SKIN->td_header[] = array( "Group" , "20%" ); + $SKIN->td_header[] = array( "Posts" , "10%" ); + $SKIN->td_header[] = array( "Email" , "20%" ); + $SKIN->td_header[] = array( "Edit Details" , "15%" ); + $SKIN->td_header[] = array( "Change Name" , "15%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "{$count['count']} Search Results" ); + + //+------------------------------- + // Run the query + //+------------------------------- + + $DB->query($query); + + while ( $r = $DB->fetch_row() ) + { + $ADMIN->html .= $SKIN->add_td_row( array( "{$r['name']}
    (IP Address: {$r['ip_address']})", + $r['g_title'], + "
    ".$r['posts']."
    ", + "
    ".$r['email']."
    ", + "Edit Details", + "Change Name" + ) ); + } + + $ADMIN->html .= $SKIN->add_td_basic($pages, 'right', 'catrow'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + // + // DO EDIT FORM + // + //+--------------------------------------------------------------------------------- + + function do_edit_form() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; + + require $root_path."sources/lib/post_parser.php"; + + $parser = new post_parser(); + + if ($IN['MEMBER_ID'] == "") + { + $ADMIN->error("Could not resolve member id"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); + $mem = $DB->fetch_row(); + + //+------------------------------- + + if ($mem['id'] == "") + { + $ADMIN->error("Could not resolve member id"); + } + + //+------------------------------- + + $mem_group = array(); + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $mem_group[] = array( $r['g_id'] , $r['g_title'] ); + } + + //+------------------------------- + + $lang_array = array(); + + $DB->query("SELECT ldir, lname FROM ibf_languages"); + + while ( $l = $DB->fetch_row() ) + { + $lang_array[] = array( $l['ldir'], $l['lname'] ); + } + + //+------------------------------- + + $DB->query("SELECT uid, sid, sname, default_set, hidden FROM ibf_skins"); + + $skin_array = array(); + + $def_skin = ""; + + if ( $DB->get_num_rows() ) + { + while ( $s = $DB->fetch_row() ) + { + if ($s['default_set'] == 1) + { + $def_skin = $s['sid']; + } + + if ($s['hidden'] == 1) + { + $hidden = " *(Hidden)"; + } + else + { + $hidden = ""; + } + + $skin_array[] = array( $s['sid'], $s['sname'].$hidden ); + + } + } + + //+------------------------------- + + if ($INFO['default_language'] == "") + { + $INFO['default_language'] = 'en'; + } + + //----------------------------------------------- + // Custom profile fields stuff + //----------------------------------------------- + + $custom_output = ""; + $field_data = array(); + + $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$IN['MEMBER_ID']."'"); + + while ( $content = $DB->fetch_row() ) + { + foreach($content as $k => $v) + { + if ( preg_match( "/^field_(\d+)$/", $k, $match) ) + { + $field_data[ $match[1] ] = $v; + } + } + } + + $DB->query("SELECT * from ibf_pfields_data ORDER BY forder"); + + while( $row = $DB->fetch_row() ) + { + $form_element = ""; + + if ( $row['ftype'] == 'drop' ) + { + $carray = explode( '|', trim($row['fcontent']) ); + + $d_content = array(); + + foreach( $carray as $entry ) + { + $value = explode( '=', $entry ); + + $ov = trim($value[0]); + $td = trim($value[1]); + + if ($ov != "" and $td !="") + { + $d_content[] = array( $ov, $td ); + } + } + + $form_element = $SKIN->form_dropdown( 'field_'.$row['fid'], $d_content, $field_data[$row['fid']] ); + + } + else if ( $row['ftype'] == 'area' ) + { + $form_element = $SKIN->form_textarea( 'field_'.$row['fid'], $field_data[$row['fid']] ); + } + else + { + $form_element = $SKIN->form_input( 'field_'.$row['fid'], $field_data[$row['fid']] ); + } + + $custom_out .= $SKIN->add_td_row( array( "{$row['ftitle']}
    {$row['desc']}" , $form_element ) ); + + } + + + //+------------------------------- + + + $ADMIN->page_title = "Edit member: ".$mem['name']." (ID: ".$mem['id'].")"; + + $ADMIN->page_detail = "You may alter the members settings from here."; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doedit' ), + 2 => array( 'act' , 'mem' ), + 3 => array( 'mid' , $mem['id'] ), + 4 => array( 'curpass', $mem['password'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Member Security Settings" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "IP address when registered" ,$mem['ip_address'] ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow {$mem['name']} to post where allowed?" , + $SKIN->form_yes_no("allow_post", $mem['allow_post'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Member Group" , + $SKIN->form_dropdown( "mgroup", + $mem_group, + $mem['mgroup'] + ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Member Title" , + $SKIN->form_input("title", $mem['title']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Require moderator preview of all posts by this member?
    If yes, all posts by this member will be put into the moderation queue." , + $SKIN->form_yes_no("mod_posts", $mem['mod_posts']) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Password Control" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "New Password
    (Leave this blank if you do not wish to reset password!)" , + $SKIN->form_input("password") + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+-------------------------------+ + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+-------------------------------+ + + $ADMIN->html .= $SKIN->start_table( "Board Settings" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Language Choice" , + $SKIN->form_dropdown( "language", + $lang_array, + $mem['language'] != "" ? $mem['language'] : $INFO['default_language'] + ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Skin Choice" , + $SKIN->form_dropdown( "skin", + $skin_array, + $mem['skin'] != "" ? $mem['skin'] : $def_skin + ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Hide this members email address?" , + $SKIN->form_yes_no("hide_email", $mem['hide_email'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email a PM reminder?" , + $SKIN->form_yes_no("email_pm", $mem['email_pm'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+-------------------------------+ + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+-------------------------------+ + + $ADMIN->html .= $SKIN->start_table( "Contact Information" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Email Address" , + $SKIN->form_input("email", $mem['email']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "AIM Identity" , + $SKIN->form_input("aim_name", $mem['aim_name']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "ICQ Number" , + $SKIN->form_input("icq_number", $mem['icq_number']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Yahoo Identity" , + $SKIN->form_input("yahoo", $mem['yahoo']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "MSN Identity" , + $SKIN->form_input("msnname", $mem['msnname']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Website Address" , + $SKIN->form_input("website", $mem['website']) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+-------------------------------+ + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+-------------------------------+ + + $ADMIN->html .= $SKIN->start_table( "Other Information" ); + + //+------------------------------- + + $mem['signature'] = $parser->unconvert( $mem['signature'] ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Avatar" , + $SKIN->form_input("avatar", $mem['avatar']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Avatar Size" , + $SKIN->form_input("avatar_size", $mem['avatar_size']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Post Count" , + $SKIN->form_input("posts", $mem['posts']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Location" , + $SKIN->form_input("location", $mem['location']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Interests" , + $SKIN->form_textarea("interests", $mem['interests']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Signature" , + $SKIN->form_textarea("signature", $mem['signature']) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+-------------------------------+ + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+-------------------------------+ + + $ADMIN->html .= $SKIN->start_table( "Validation Keys" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Validation Key
    (Do not alter unless you are sure it is no longer needed!)" , + $SKIN->form_input("validate_key", $mem['validate_key']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "New Password (MD5)
    (Do not alter unless you are sure it is no longer needed!)" , + $SKIN->form_input("new_pass", $mem['new_pass']) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Previous Member Group ID
    (Do not alter unless you are sure it is no longer needed!)" , + $SKIN->form_input("prev_group", $mem['prev_group']) + ) ); + + //+------------------------------- + + if ($custom_out != "") + { + + $ADMIN->html .= $SKIN->end_table(); + + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+-------------------------------+ + + $ADMIN->html .= $SKIN->start_table( "Custom Profile Fields" ); + + + $ADMIN->html .= $custom_out; + + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->end_form("Edit this member"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + + //+--------------------------------------------------------------------------------- + + function do_edit() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $ibforums; + + $DB->query("SELECT name FROM ibf_members WHERE id='".$IN['mid']."'"); + + $memb = $DB->fetch_row(); + + $password = ""; + + if ($IN['password'] != "") + { + $password = ", password='".md5($IN['password'])."'"; + } + + require $root_path."sources/lib/post_parser.php"; + + $parser = new post_parser(); + + $IN['signature'] = $parser->convert( array ('TEXT' => $IN['signature'], + 'SMILIES' => 0, + 'CODE' => $INFO['sig_allow_ibc'], + 'HTML' => $INFO['sig_allow_html'], + 'SIGNATURE' => 1 + ) ); + + $db_string = $DB->compile_db_update_string( array ( + 'allow_post' => $IN['allow_post'], + 'mgroup' => $IN['mgroup'], + 'title' => $IN['title'], + 'validate_key' => $IN['validate_key'], + 'new_pass' => $IN['new_pass'], + 'prev_group' => $IN['prev_group'], + 'language' => $IN['language'], + 'skin' => $IN['skin'], + 'hide_email' => $IN['hide_email'], + 'email_pm' => $IN['email_pm'], + 'email' => $IN['email'], + 'aim_name' => $IN['aim_name'], + 'icq_number' => $IN['icq_number'], + 'yahoo' => $IN['yahoo'], + 'msnname' => $IN['msnname'], + 'website' => $IN['website'], + 'avatar' => $IN['avatar'], + 'avatar_size' => $IN['avatar_size'], + 'posts' => $IN['posts'], + 'location' => $IN['location'], + 'interests' => $IN['interests'], + 'signature' => $IN['signature'], + 'mod_posts' => $IN['mod_posts'], + ) ); + + $DB->query("UPDATE ibf_members SET $db_string".$password." WHERE id='".$IN['mid']."'"); + + //---------------------------------- + // Custom profile field stuff + //---------------------------------- + + $custom_fields = array(); + + $DB->query("SELECT * from ibf_pfields_data"); + + while ( $row = $DB->fetch_row() ) + { + $custom_fields[ 'field_'.$row['fid'] ] = $IN[ 'field_'.$row['fid'] ]; + } + + if ( count($custom_fields) > 0 ) + { + // Do we already have an entry in the content table? + + $DB->query("SELECT member_id FROM ibf_pfields_content WHERE member_id='".$IN['mid']."'"); + $test = $DB->fetch_row(); + + if ( $test['member_id'] ) + { + // We have it, so simply update + + $db_string = $DB->compile_db_update_string($custom_fields); + + $DB->query("UPDATE ibf_pfields_content SET $db_string WHERE member_id='".$IN['mid']."'"); + } + else + { + $custom_fields['member_id'] = $IN['mid']; + + $db_string = $DB->compile_db_insert_string($custom_fields); + + $DB->query("INSERT INTO ibf_pfields_content (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + } + } + + $ADMIN->save_log("Edited Member '{$memb['name']}' account"); + + $ADMIN->done_screen("Member Edited", "Member Control", "act=mem&code=edit" ); + + } + + + + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_moderator.php b/upload/sources/Admin/ad_moderator.php index 7b1383bb..c52e53da 100644 --- a/upload/sources/Admin/ad_moderator.php +++ b/upload/sources/Admin/ad_moderator.php @@ -1,766 +1,910 @@ - Admin Category functions -| > Module written by Matt Mecham -| > Date started: 1st march 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - -$idx = new ad_mod(); - - -class ad_mod { - - var $base_url; - - function ad_mod() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'add': - $this->add_one(); - break; - case 'add_two': - $this->add_two(); - break; - case 'add_final': - $this->mod_form('add'); - break; - case 'doadd': - $this->add_mod(); - break; - - case 'edit': - $this->mod_form('edit'); - break; - - case 'doedit': - $this->do_edit(); - break; - - case 'remove': - $this->do_delete(); - break; - - default: - $this->show_list(); - break; - } - - } - - //+--------------------------------------------------------------------------------- - // - // DELETE MODERATOR - // - //+--------------------------------------------------------------------------------- - - function do_delete() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['mid'] == "") - { - $ADMIN->error("You did not choose a valid moderator ID"); - } - - $DB->query("DELETE FROM ibf_moderators WHERE mid='".$IN['mid']."'"); - - $ADMIN->done_screen("Moderator Removed", "Moderator Control", "act=mod" ); - - } - - - //+--------------------------------------------------------------------------------- - // - // EDIT MODERATOR - // - //+--------------------------------------------------------------------------------- - - function do_edit() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['mid'] == "") - { - $ADMIN->error("You did not choose a valid moderator ID"); - } - - //-------------------------------------- - // Build Mr Hash - //-------------------------------------- - - $mr_hash = array( - 'forum_id' => $IN['forum_id'], - 'edit_post' => $IN['edit_post'], - 'edit_topic' => $IN['edit_topic'], - 'delete_post' => $IN['delete_post'], - 'delete_topic' => $IN['delete_topic'], - 'view_ip' => $IN['view_ip'], - 'open_topic' => $IN['open_topic'], - 'close_topic' => $IN['close_topic'], - 'mass_move' => $IN['mass_move'], - 'mass_prune' => $IN['mass_prune'], - 'move_topic' => $IN['move_topic'], - 'pin_topic' => $IN['pin_topic'], - 'unpin_topic' => $IN['unpin_topic'], - 'post_q' => $IN['post_q'], - 'topic_q' => $IN['topic_q'], - 'allow_warn' => $IN['allow_warn'], - 'edit_user' => $IN['edit_user'] - ); - - - - $db_string = $DB->compile_db_update_string( $mr_hash ); - - $DB->query("UPDATE ibf_moderators SET $db_string WHERE mid='".$IN['mid']."'"); - - $ADMIN->done_screen("Moderator Edited", "Moderator Control", "act=mod" ); - - } - - //+--------------------------------------------------------------------------------- - // - // ADD MODERATOR - // - //+--------------------------------------------------------------------------------- - - function add_mod() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['fid'] == "") - { - $ADMIN->error("You did not choose any forums to add this member to"); - } - - if ($IN['mem'] == "") - { - $ADMIN->error("You did not choose a member to add as a moderator"); - } - - $DB->query("SELECT id, name from ibf_members WHERE id='".$IN['mem']."'"); - - if ( ! $mem = $DB->fetch_row() ) - { - $ADMIN->error("Could not match that member name so there."); - } - - //-------------------------------------- - // Check for legal forums - //-------------------------------------- - - $forum_ids = array(); - - $DB->query("SELECT id FROM ibf_forums WHERE id IN(".$IN['fid'].")"); - - while( $i = $DB->fetch_row() ) - { - $forum_ids[] = $i['id']; - } - - if ( count($forum_ids) == 0) - { - $ADMIN->error("We could not match any forums with those IDS"); - } - - //-------------------------------------- - // Build Mr Hash - //-------------------------------------- - - $mr_hash = array( - 'member_name' => $mem['name'], - 'member_id' => $mem['id'], - 'edit_post' => $IN['edit_post'], - 'edit_topic' => $IN['edit_topic'], - 'delete_post' => $IN['delete_post'], - 'delete_topic' => $IN['delete_topic'], - 'view_ip' => $IN['view_ip'], - 'open_topic' => $IN['open_topic'], - 'close_topic' => $IN['close_topic'], - 'mass_move' => $IN['mass_move'], - 'mass_prune' => $IN['mass_prune'], - 'move_topic' => $IN['move_topic'], - 'pin_topic' => $IN['pin_topic'], - 'unpin_topic' => $IN['unpin_topic'], - 'post_q' => $IN['post_q'], - 'topic_q' => $IN['topic_q'], - 'allow_warn' => $IN['allow_warn'], - 'edit_user' => $IN['edit_user'] - ); - - //-------------------------------------- - // Loopy loopy - //-------------------------------------- - - foreach ($forum_ids as $cartman) - { - $mr_hash['forum_id'] = $cartman; - - $kenny = $DB->compile_db_insert_string( $mr_hash ); - - $DB->query("INSERT INTO ibf_moderators (" .$kenny['FIELD_NAMES']. ") VALUES (". $kenny['FIELD_VALUES'] .")"); - } - - $ADMIN->done_screen("Moderator Added", "Moderator Control", "act=mod" ); - - } - - //+--------------------------------------------------------------------------------- - // - // ADD FINAL, display the add / edit form - // - //+--------------------------------------------------------------------------------- - - function mod_form( $type='add' ) { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($type == 'add') - { - if ($IN['fid'] == "") - { - $ADMIN->error("You did not choose any forums to add this member to"); - } - - $mod = array(); - $names = array(); - - //-------------------------------------- - - $DB->query("SELECT name FROM ibf_forums WHERE id IN(".$IN['fid'].")"); - - while ( $r = $DB->fetch_row() ) - { - $names[] = $r['name']; - } - - $thenames = implode( ", ", $names ); - - //-------------------------------------- - - $button = "Add this moderator"; - - $form_code = 'doadd'; - - if ($IN['MEMBER_ID'] == "") - { - $ADMIN->error("Could not resolve the member id bucko"); - } - else - { - $DB->query("SELECT name, id FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); - - if ( ! $mem = $DB->fetch_row() ) - { - $ADMIN->error("That member ID does not resolve"); - } - - $member_id = $mem['id']; - $member_name = $mem['name']; - } - - $ADMIN->page_detail = "Adding a $member_name as a moderator to: $thenames"; - $ADMIN->page_title = "Add a moderator"; - - } - else - { - if ($IN['mid'] == "") - { - $ADMIN->error("You must choose a valid moderator to edit."); - } - - $button = "Edit this moderator"; - - $form_code = "doedit"; - - $ADMIN->page_title = "Editing a moderator"; - $ADMIN->page_detail = "Please check the information carefully before submitting the form"; - - $DB->query("SELECT * from ibf_moderators WHERE mid='".$IN['mid']."'"); - - if ( ! $mod = $DB->fetch_row() ) - { - $ADMIN->error("Could not retrieve that moderators record"); - } - - $member_id = $mod['member_id']; - $member_name = $mod['member_name']; - } - - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), - 2 => array( 'act' , 'mod' ), - 3 => array( 'mid' , $mod['mid']), - 4 => array( 'fid' , $IN['fid'] ), - 5 => array( 'mem' , $member_id ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "General Settings" ); - - //+------------------------------- - - if ($type == 'edit') - { - $forums = array(); - - $DB->query("SELECT id, name FROM ibf_forums ORDER BY position"); - - while ( $r = $DB->fetch_row() ) - { - $forums[] = array( $r['id'], $r['name'] ); - } - - $ADMIN->html .= $SKIN->add_td_row( array( "Moderates forum..." , - $SKIN->form_dropdown( "forum_id", $forums, $mod['forum_id'] ) - ) ); - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Can edit others posts/polls?" , - $SKIN->form_yes_no("edit_post", $mod['edit_post'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can edit others topic titles?" , - $SKIN->form_yes_no("edit_topic", $mod['edit_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can delete others posts?" , - $SKIN->form_yes_no("delete_post", $mod['delete_post'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can delete others topics/polls?" , - $SKIN->form_yes_no("delete_topic", $mod['delete_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can view posters IP addresses?" , - $SKIN->form_yes_no("view_ip", $mod['view_ip'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can open locked topics?" , - $SKIN->form_yes_no("open_topic", $mod['open_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can close open topics?" , - $SKIN->form_yes_no("close_topic", $mod['close_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can move topics?" , - $SKIN->form_yes_no("move_topic", $mod['move_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can pin topics?" , - $SKIN->form_yes_no("pin_topic", $mod['pin_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can unpin topics?" , - $SKIN->form_yes_no("unpin_topic", $mod['unpin_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Moderator Control Panel Settings" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Can mass move topics?" , - $SKIN->form_yes_no("mass_move", $mod['mass_move'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can mass prune topics?" , - $SKIN->form_yes_no("mass_prune", $mod['mass_prune'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can manage queued topics?" , - $SKIN->form_yes_no("topic_q", $mod['topic_q'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can manage queued posts?" , - $SKIN->form_yes_no("post_q", $mod['post_q'] ) - ) ); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Advanced Settings" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Can warn other users?" , - $SKIN->form_yes_no("allow_warn", $mod['allow_warn'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Can edit user avatars and signatures?" , - $SKIN->form_yes_no("edit_user", $mod['edit_user'] ) - ) ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - - //+--------------------------------------------------------------------------------- - // - // ADD step one: Look up a member - // - //+--------------------------------------------------------------------------------- - - function add_one() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //----------------------------- - // Grab and serialize the input - //----------------------------- - - $fid = ""; - $fidarray = array(); - - foreach ($IN as $k => $v) - { - if ( preg_match( "/^add_(\d+)$/", $k, $match ) ) - { - if ($IN[ $match[0] ]) - { - $fidarray[] = $match[1]; - } - } - } - - if ( count($fidarray) < 1 ) - { - $ADMIN->error("You must select a forum, or forums to add a moderator to. You can do this by checking the checkboxes to the left of the forum name"); - } - - $fid = implode( "," ,$fidarray ); - - $ADMIN->page_title = "Add a moderator"; - - $ADMIN->page_detail = "Please find a member to moderate the forums you previously selected."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add_two' ), - 2 => array( 'act' , 'mod' ), - 3 => array( 'fid' , $fid ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Search for a member" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , - $SKIN->form_input( "USER_NAME" ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Find Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - - } - - //+--------------------------------------------------------------------------------- - // - // REFINE MEMBER SEARCH - // - //+--------------------------------------------------------------------------------- - - function add_two() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['USER_NAME'] == "") - { - $ADMIN->error("You didn't choose a member name to look for!"); - } - - $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'"); - - if (! $DB->get_num_rows() ) - { - $ADMIN->error("Sorry, we could not find any members that matched the search string you entered"); - } - - $form_array = array(); - - while ( $r = $DB->fetch_row() ) - { - $form_array[] = array( $r['id'] , $r['name'] ); - } - - - - $ADMIN->page_title = "Add a moderator"; - - $ADMIN->page_detail = "Please select the correct member name from the selection below to add as a moderator to the previously selected forums."; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add_final' ), - 2 => array( 'act' , 'mod' ), - 3 => array( 'fid' , $IN['fid']), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Search for a member" ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Choose from the matches..." , - $SKIN->form_dropdown( "MEMBER_ID", $form_array ) - ) ); - - $ADMIN->html .= $SKIN->end_form("Choose Member"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - - //+--------------------------------------------------------------------------------- - // - // SHOW LIST - // Renders a complete listing of all the forums and categories w/mods. - // - //+--------------------------------------------------------------------------------- - - function show_list() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_title = "Moderator Control Overview"; - $ADMIN->page_detail = "This section allows you to edit, remove and add new moderators to your forums"; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'mod' ), - ) ); - - $SKIN->td_header[] = array( "Add" , "5%" ); - $SKIN->td_header[] = array( "Forum Name" , "30%" ); - $SKIN->td_header[] = array( "Posts" , "10%" ); - $SKIN->td_header[] = array( "Topics" , "10%" ); - $SKIN->td_header[] = array( "Current Moderators" , "45%" ); - - $ADMIN->html .= $SKIN->start_table( "Your Categories and Forums" ); - - //------------------------------------ - - $cats = array(); - $forums = array(); - $mods = array(); - $children = array(); - - $DB->query("SELECT * from ibf_categories where id > 0 ORDER BY position ASC"); - while ($r = $DB->fetch_row()) - { - $cats[$r['id']] = $r; - } - - $DB->query("SELECT * from ibf_forums ORDER BY position ASC"); - while ($r = $DB->fetch_row()) - { - - if ($r['parent_id'] > 0) - { - $children[ $r['parent_id'] ][] = $r; - } - else - { - $forums[] = $r; - } - - } - - $DB->query("SELECT * from ibf_moderators"); - while ($r = $DB->fetch_row()) - { - $mods[] = $r; - } - - //------------------------------------ - - $last_cat_id = -1; - - foreach ($cats as $c) - { - - $ADMIN->html .= $SKIN->add_td_row( array( - ' ', - "".$c['name']."", - ' ', - ' ', - ' ', - ), 'catrow' ); - $last_cat_id = $c['id']; - - - foreach($forums as $r) - { - - if ($r['category'] == $last_cat_id) - { - - $mod_string = ""; - - foreach( $mods as $phpid => $data ) - { - if ($data['forum_id'] == $r['id']) - { - $mod_string .= "
    - - - - "; - } - } - - if ($mod_string != "") - { - $these_mods = "
    {$data['member_name']}RemoveEdit
    ".$mod_string."
    "; - } - else - { - $these_mods = "
    Unmoderated
    "; - } - - if ($r['subwrap'] == 1) - { - - $ADMIN->html .= $SKIN->add_td_row( array( - ' ', - $c['name'], - ' ', - ' ', - ' ', - ), 'catrow2' ); - } - else - { - $ADMIN->html .= $SKIN->add_td_row( array( - "
    ", - "".$r['name']."
    ".$r['description'], - $r['posts'], - $r['topics'], - $these_mods - ) ); - } - - if ( ( isset($children[ $r['id'] ]) ) and ( count ($children[ $r['id'] ]) > 0 ) ) - { - foreach($children[ $r['id'] ] as $idx => $rd) - { - - $mod_string = ""; - - foreach( $mods as $phpid => $data ) - { - if ($data['forum_id'] == $rd['id']) - { - $mod_string .= " - {$data['member_name']} - Remove - Edit - "; - } - } - - if ($mod_string != "") - { - $these_mods = "".$mod_string."
    "; - } - else - { - $these_mods = "
    Unmoderated
    "; - } - - $ADMIN->html .= $SKIN->add_td_row( array( - "
    ", - "".$rd['name']."
    ".$rd['description'], - $rd['posts'], - $rd['topics'], - $these_mods - ) ,'subforum' ); - } - } - } - } - } - - $ADMIN->html .= $SKIN->end_form("Add a moderator to the selected forums"); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - - - - -} - - + Admin Category functions +| > Module written by Matt Mecham +| > Date started: 1st march 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + +$idx = new ad_mod(); + + +class ad_mod { + + var $base_url; + + function ad_mod() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'add': + $this->add_one(); + break; + case 'add_two': + $this->add_two(); + break; + case 'add_final': + $this->mod_form('add'); + break; + case 'doadd': + $this->add_mod(); + break; + + case 'edit': + $this->mod_form('edit'); + break; + + case 'doedit': + $this->do_edit(); + break; + + case 'remove': + $this->do_delete(); + break; + + default: + $this->show_list(); + break; + } + + } + + //+--------------------------------------------------------------------------------- + // + // DELETE MODERATOR + // + //+--------------------------------------------------------------------------------- + + function do_delete() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['mid'] == "") + { + $ADMIN->error("You did not choose a valid moderator ID"); + } + + $DB->query("SELECT member_name FROM ibf_moderators WHERE mid='".$IN['mid']."'"); + $mod = $DB->fetch_row(); + + $DB->query("DELETE FROM ibf_moderators WHERE mid='".$IN['mid']."'"); + + $ADMIN->save_log("Removed Moderator '{$mod['member_name']}'"); + + $ADMIN->done_screen("Moderator Removed", "Moderator Control", "act=mod" ); + + } + + + //+--------------------------------------------------------------------------------- + // + // EDIT MODERATOR + // + //+--------------------------------------------------------------------------------- + + function do_edit() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['mid'] == "") + { + $ADMIN->error("You did not choose a valid moderator ID"); + } + + $DB->query("SELECT member_name FROM ibf_moderators WHERE mid='".$IN['mid']."'"); + $mod = $DB->fetch_row(); + + //-------------------------------------- + // Build Mr Hash + //-------------------------------------- + + $mr_hash = array( + 'forum_id' => $IN['forum_id'], + 'edit_post' => $IN['edit_post'], + 'edit_topic' => $IN['edit_topic'], + 'delete_post' => $IN['delete_post'], + 'delete_topic' => $IN['delete_topic'], + 'view_ip' => $IN['view_ip'], + 'open_topic' => $IN['open_topic'], + 'close_topic' => $IN['close_topic'], + 'mass_move' => $IN['mass_move'], + 'mass_prune' => $IN['mass_prune'], + 'move_topic' => $IN['move_topic'], + 'pin_topic' => $IN['pin_topic'], + 'unpin_topic' => $IN['unpin_topic'], + 'post_q' => $IN['post_q'], + 'topic_q' => $IN['topic_q'], + 'allow_warn' => $IN['allow_warn'], + 'split_merge' => $IN['split_merge'], + 'edit_user' => $IN['edit_user'] + ); + + + + $db_string = $DB->compile_db_update_string( $mr_hash ); + + $DB->query("UPDATE ibf_moderators SET $db_string WHERE mid='".$IN['mid']."'"); + + $ADMIN->save_log("Edited Moderator '{$mod['member_name']}'"); + + $ADMIN->done_screen("Moderator Edited", "Moderator Control", "act=mod" ); + + } + + //+--------------------------------------------------------------------------------- + // + // ADD MODERATOR + // + //+--------------------------------------------------------------------------------- + + function add_mod() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['fid'] == "") + { + $ADMIN->error("You did not choose any forums to add this member to"); + } + + //-------------------------------------- + // Build Mr Hash + //-------------------------------------- + + $mr_hash = array( + 'edit_post' => $IN['edit_post'], + 'edit_topic' => $IN['edit_topic'], + 'delete_post' => $IN['delete_post'], + 'delete_topic' => $IN['delete_topic'], + 'view_ip' => $IN['view_ip'], + 'open_topic' => $IN['open_topic'], + 'close_topic' => $IN['close_topic'], + 'mass_move' => $IN['mass_move'], + 'mass_prune' => $IN['mass_prune'], + 'move_topic' => $IN['move_topic'], + 'pin_topic' => $IN['pin_topic'], + 'unpin_topic' => $IN['unpin_topic'], + 'post_q' => $IN['post_q'], + 'topic_q' => $IN['topic_q'], + 'allow_warn' => $IN['allow_warn'], + 'split_merge' => $IN['split_merge'], + 'edit_user' => $IN['edit_user'] + ); + + if ($IN['mod_type'] == 'group') + { + + if ($IN['gid'] == "") + { + $ADMIN->error("We could not match that group ID"); + } + + $DB->query("SELECT g_id, g_title FROM ibf_groups WHERE g_id='".$IN['gid']."'"); + + if ( ! $group = $DB->fetch_row() ) + { + $ADMIN->error("We could not match that group ID"); + } + + $mr_hash['member_name'] = '-1'; + $mr_hash['member_id'] = '-1'; + $mr_hash['group_id'] = $group['g_id']; + $mr_hash['group_name'] = $group['g_title']; + $mr_hash['is_group'] = 1; + + $ad_log = "Added Group '{$group['g_title']}' as a moderator"; + + } + else + { + + if ($IN['mem'] == "") + { + $ADMIN->error("You did not choose a member to add as a moderator"); + } + + $DB->query("SELECT id, name from ibf_members WHERE id='".$IN['mem']."'"); + + if ( ! $mem = $DB->fetch_row() ) + { + $ADMIN->error("Could not match that member name so there."); + } + + $mr_hash['member_name'] = $mem['name']; + $mr_hash['member_id'] = $mem['id']; + $mr_hash['is_group'] = 0; + + $ad_log = "Added Member '{$mem['name']}' as a moderator"; + + } + + //-------------------------------------- + // Check for legal forums + //-------------------------------------- + + $forum_ids = array(); + + $DB->query("SELECT id FROM ibf_forums WHERE id IN(".$IN['fid'].")"); + + while( $i = $DB->fetch_row() ) + { + $forum_ids[] = $i['id']; + } + + if ( count($forum_ids) == 0) + { + $ADMIN->error("We could not match any forums with those IDS"); + } + + + + //-------------------------------------- + // Loopy loopy + //-------------------------------------- + + foreach ($forum_ids as $cartman) + { + $mr_hash['forum_id'] = $cartman; + + $kenny = $DB->compile_db_insert_string( $mr_hash ); + + $DB->query("INSERT INTO ibf_moderators (" .$kenny['FIELD_NAMES']. ") VALUES (". $kenny['FIELD_VALUES'] .")"); + } + + $ADMIN->save_log($ad_log); + + $ADMIN->done_screen("Moderator Added", "Moderator Control", "act=mod" ); + + } + + //+--------------------------------------------------------------------------------- + // + // ADD FINAL, display the add / edit form + // + //+--------------------------------------------------------------------------------- + + function mod_form( $type='add' ) { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $group = array(); + + if ($type == 'add') + { + if ($IN['fid'] == "") + { + $ADMIN->error("You did not choose any forums to add this member to"); + } + + $mod = array(); + $names = array(); + + //-------------------------------------- + + $DB->query("SELECT name FROM ibf_forums WHERE id IN(".$IN['fid'].")"); + + while ( $r = $DB->fetch_row() ) + { + $names[] = $r['name']; + } + + $thenames = implode( ", ", $names ); + + //-------------------------------------- + + $button = "Add this moderator"; + + $form_code = 'doadd'; + + if ($IN['mod_type'] == 'group') + { + $DB->query("SELECT g_id, g_title FROM ibf_groups WHERE g_id='".$IN['mod_group']."'"); + + if (! $group = $DB->fetch_row() ) + { + $ADMIN->error("Could not find that group to add as a moderator"); + } + + $ADMIN->page_detail = "Adding group: {$group['g_title']} as a moderator to: $thenames"; + $ADMIN->page_title = "Add a moderator group"; + } + else + { + + if ($IN['MEMBER_ID'] == "") + { + $ADMIN->error("Could not resolve the member id bucko"); + } + else + { + $DB->query("SELECT name, id FROM ibf_members WHERE id='".$IN['MEMBER_ID']."'"); + + if ( ! $mem = $DB->fetch_row() ) + { + $ADMIN->error("That member ID does not resolve"); + } + + $member_id = $mem['id']; + $member_name = $mem['name']; + } + + $ADMIN->page_detail = "Adding a $member_name as a moderator to: $thenames"; + $ADMIN->page_title = "Add a moderator"; + + } + + } + else + { + if ($IN['mid'] == "") + { + $ADMIN->error("You must choose a valid moderator to edit."); + } + + $button = "Edit this moderator"; + + $form_code = "doedit"; + + $ADMIN->page_title = "Editing a moderator"; + $ADMIN->page_detail = "Please check the information carefully before submitting the form"; + + $DB->query("SELECT * from ibf_moderators WHERE mid='".$IN['mid']."'"); + + if ( ! $mod = $DB->fetch_row() ) + { + $ADMIN->error("Could not retrieve that moderators record"); + } + + $member_id = $mod['member_id']; + $member_name = $mod['member_name']; + } + + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), + 2 => array( 'act' , 'mod' ), + 3 => array( 'mid' , $mod['mid']), + 4 => array( 'fid' , $IN['fid'] ), + 5 => array( 'mem' , $member_id ), + 6 => array( 'mod_type' , $IN['mod_type'] ), + 7 => array( 'gid' , $group['g_id'] ), + 8 => array( 'gname' , $group['g_name'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "General Settings" ); + + //+------------------------------- + + if ($type == 'edit') + { + $forums = array(); + + $DB->query("SELECT id, name FROM ibf_forums ORDER BY position"); + + while ( $r = $DB->fetch_row() ) + { + $forums[] = array( $r['id'], $r['name'] ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Moderates forum..." , + $SKIN->form_dropdown( "forum_id", $forums, $mod['forum_id'] ) + ) ); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Can edit others posts/polls?" , + $SKIN->form_yes_no("edit_post", $mod['edit_post'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can edit others topic titles?" , + $SKIN->form_yes_no("edit_topic", $mod['edit_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can delete others posts?" , + $SKIN->form_yes_no("delete_post", $mod['delete_post'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can delete others topics/polls?" , + $SKIN->form_yes_no("delete_topic", $mod['delete_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can view posters IP addresses?" , + $SKIN->form_yes_no("view_ip", $mod['view_ip'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can open locked topics?" , + $SKIN->form_yes_no("open_topic", $mod['open_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can close open topics?" , + $SKIN->form_yes_no("close_topic", $mod['close_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can move topics?" , + $SKIN->form_yes_no("move_topic", $mod['move_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can pin topics?" , + $SKIN->form_yes_no("pin_topic", $mod['pin_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can unpin topics?" , + $SKIN->form_yes_no("unpin_topic", $mod['unpin_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can split / merge topics?" , + $SKIN->form_yes_no("split_merge", $mod['split_merge'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Moderator Control Panel Settings" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Can mass move topics?" , + $SKIN->form_yes_no("mass_move", $mod['mass_move'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can mass prune topics?" , + $SKIN->form_yes_no("mass_prune", $mod['mass_prune'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can manage queued topics?" , + $SKIN->form_yes_no("topic_q", $mod['topic_q'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can manage queued posts?" , + $SKIN->form_yes_no("post_q", $mod['post_q'] ) + ) ); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Advanced Settings" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Can warn other users?" , + $SKIN->form_yes_no("allow_warn", $mod['allow_warn'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Can edit user avatars and signatures?" , + $SKIN->form_yes_no("edit_user", $mod['edit_user'] ) + ) ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + + //+--------------------------------------------------------------------------------- + // + // ADD step one: Look up a member + // + //+--------------------------------------------------------------------------------- + + function add_one() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //----------------------------- + // Grab and serialize the input + //----------------------------- + + $fid = ""; + $fidarray = array(); + + foreach ($IN as $k => $v) + { + if ( preg_match( "/^add_(\d+)$/", $k, $match ) ) + { + if ($IN[ $match[0] ]) + { + $fidarray[] = $match[1]; + } + } + } + + if ( count($fidarray) < 1 ) + { + $ADMIN->error("You must select a forum, or forums to add a moderator to. You can do this by checking the checkboxes to the left of the forum name"); + } + + $fid = implode( "," ,$fidarray ); + + $ADMIN->page_title = "Add a moderator"; + + $ADMIN->page_detail = "Please find a member or group to moderate the forums you previously selected."; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add_two' ), + 2 => array( 'act' , 'mod' ), + 3 => array( 'fid' , $fid ), + 4 => array( 'mod_type' , $IN['mod_type'] ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + if ($IN['mod_type'] == 'member') + { + + $ADMIN->html .= $SKIN->start_table( "Search for a member" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Enter part or all of the usersname" , + $SKIN->form_input( "USER_NAME" ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Find Member"); + + $ADMIN->html .= $SKIN->end_table(); + + } + else + { + // Get the group ID's and names + + $mem_group = array(); + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $mem_group[] = array( $r['g_id'] , $r['g_title'] ); + } + + $ADMIN->html .= $SKIN->start_table( "Choose a group as a moderator" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Select a group" , + $SKIN->form_dropdown( "mod_group", $mem_group ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Add this group"); + + $ADMIN->html .= $SKIN->end_table(); + + } + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + // + // REFINE MEMBER SEARCH + // + //+--------------------------------------------------------------------------------- + + function add_two() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + // Are we adding a group as a mod? If so, bounce straight to the mod perms form + + if ($IN['mod_type'] == 'group') + { + $this->mod_form(); + exit(); + } + + // Else continue as normal. + + if ($IN['USER_NAME'] == "") + { + $ADMIN->error("You didn't choose a member name to look for!"); + } + + $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'"); + + if (! $DB->get_num_rows() ) + { + $ADMIN->error("Sorry, we could not find any members that matched the search string you entered"); + } + + $form_array = array(); + + while ( $r = $DB->fetch_row() ) + { + $form_array[] = array( $r['id'] , $r['name'] ); + } + + + + $ADMIN->page_title = "Add a moderator"; + + $ADMIN->page_detail = "Please select the correct member name from the selection below to add as a moderator to the previously selected forums."; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add_final' ), + 2 => array( 'act' , 'mod' ), + 3 => array( 'fid' , $IN['fid']), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Search for a member" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Choose from the matches..." , + $SKIN->form_dropdown( "MEMBER_ID", $form_array ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Choose Member"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + + //+--------------------------------------------------------------------------------- + // + // SHOW LIST + // Renders a complete listing of all the forums and categories w/mods. + // + //+--------------------------------------------------------------------------------- + + function show_list() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Moderator Control Overview"; + $ADMIN->page_detail = "This section allows you to edit, remove and add new moderators to your forums"; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'mod' ), + ) ); + + $SKIN->td_header[] = array( "Add" , "5%" ); + $SKIN->td_header[] = array( "Forum Name" , "30%" ); + $SKIN->td_header[] = array( "Posts" , "10%" ); + $SKIN->td_header[] = array( "Topics" , "10%" ); + $SKIN->td_header[] = array( "Current Moderators" , "45%" ); + + $ADMIN->html .= $SKIN->start_table( "Your Categories and Forums" ); + + //------------------------------------ + + $cats = array(); + $forums = array(); + $mods = array(); + $children = array(); + + $DB->query("SELECT * from ibf_categories where id > 0 ORDER BY position ASC"); + while ($r = $DB->fetch_row()) + { + $cats[$r['id']] = $r; + } + + $DB->query("SELECT * from ibf_forums ORDER BY position ASC"); + while ($r = $DB->fetch_row()) + { + + if ($r['parent_id'] > 0) + { + $children[ $r['parent_id'] ][] = $r; + } + else + { + $forums[] = $r; + } + + } + + $DB->query("SELECT * from ibf_moderators"); + while ($r = $DB->fetch_row()) + { + $mods[] = $r; + } + + //------------------------------------ + + $last_cat_id = -1; + + foreach ($cats as $c) + { + + $ADMIN->html .= $SKIN->add_td_row( array( + ' ', + "".$c['name']."", + ' ', + ' ', + ' ', + ), 'catrow' ); + $last_cat_id = $c['id']; + + + foreach($forums as $r) + { + + if ($r['category'] == $last_cat_id) + { + + $mod_string = ""; + + foreach( $mods as $phpid => $data ) + { + if ($data['forum_id'] == $r['id']) + { + if ($data['is_group'] == 1) + { + $mod_string .= " + Group: {$data['group_name']} + Remove + Edit + "; + } + else + { + $mod_string .= " + {$data['member_name']} + Remove + Edit + "; + } + } + } + + if ($mod_string != "") + { + $these_mods = "".$mod_string."
    "; + } + else + { + $these_mods = "
    Unmoderated
    "; + } + + if ($r['subwrap'] == 1) + { + + $ADMIN->html .= $SKIN->add_td_row( array( + ' ', + $c['name'], + ' ', + ' ', + ' ', + ), 'catrow2' ); + } + else + { + $ADMIN->html .= $SKIN->add_td_row( array( + "
    ", + "".$r['name']."
    ".$r['description'], + $r['posts'], + $r['topics'], + $these_mods + ) ); + } + + if ( ( isset($children[ $r['id'] ]) ) and ( count ($children[ $r['id'] ]) > 0 ) ) + { + foreach($children[ $r['id'] ] as $idx => $rd) + { + + $mod_string = ""; + + foreach( $mods as $phpid => $data ) + { + if ($data['forum_id'] == $rd['id']) + { + if ($data['is_group'] == 1) + { + $mod_string .= " + Group: {$data['group_name']} + Remove + Edit + "; + } + else + { + $mod_string .= " + {$data['member_name']} + Remove + Edit + "; + } + } + } + + if ($mod_string != "") + { + $these_mods = "".$mod_string."
    "; + } + else + { + $these_mods = "
    Unmoderated
    "; + } + + $ADMIN->html .= $SKIN->add_td_row( array( + "
    ", + "".$rd['name']."
    ".$rd['description'], + $rd['posts'], + $rd['topics'], + $these_mods + ) ,'subforum' ); + } + } + } + } + } + + $ADMIN->html .= $SKIN->add_td_basic( "Type of moderator to add:  " . $SKIN->form_dropdown( "mod_type", + array( + 0 => array( 'member', 'Single Member' ), + 1 => array( 'group', 'Member Group' ) + ) + ) , "center" ); + + $ADMIN->html .= $SKIN->end_form("Add a moderator to the selected forums"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + + + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_modlogs.php b/upload/sources/Admin/ad_modlogs.php index 129a812e..1eb18263 100644 --- a/upload/sources/Admin/ad_modlogs.php +++ b/upload/sources/Admin/ad_modlogs.php @@ -1,282 +1,284 @@ - Import functions -| > Module written by Matt Mecham -| > Date started: 22nd April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -// Ensure we've not accessed this script directly: - - - -$idx = new ad_modlogs(); - - -class ad_modlogs { - - var $base_url; - - function ad_modlogs() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - - case 'view': - $this->view(); - break; - - case 'remove': - $this->remove(); - break; - - - //------------------------- - default: - $this->list_current(); - break; - } - - } - - //--------------------------------------------- - // Remove archived files - //--------------------------------------------- - - function view() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $start = $IN['st'] ? $IN['st'] : 0; - - $ADMIN->page_detail = "Viewing all actions by a moderator"; - $ADMIN->page_title = "Moderator Logs Manager"; - - if ($IN['search_string'] == "") - { - $DB->query("SELECT COUNT(id) as count FROM ibf_moderator_logs WHERE member_id='".$IN['mid']."'"); - $row = $DB->fetch_row(); - - $row_count = $row['count']; - - $query = "&act=modlog&mid={$IN['mid']}&code=view"; - - $DB->query("SELECT m.*, f.id as forum_id, f.name FROM ibf_moderator_logs m, ibf_forums f WHERE m.member_id='".$IN['mid']."' AND f.id=m.forum_id ORDER BY m.ctime DESC LIMIT $start, 20"); - - } - else - { - $IN['search_string'] = urldecode($IN['search_string']); - - if ( ($IN['search_type'] == 'topic_id') or ($IN['search_type'] == 'forum_id') ) - { - $dbq = "m.".$IN['search_type']."='".$IN['search_string']."'"; - } - else - { - $dbq = "m.".$IN['search_type']." LIKE '%".$IN['search_string']."%'"; - } - - $DB->query("SELECT COUNT(m.id) as count FROM ibf_moderator_logs m WHERE $dbq"); - $row = $DB->fetch_row(); - - $row_count = $row['count']; - - $query = "&act=modlog&code=view&search_type={$IN['search_type']}&search_string=".urlencode($IN['search_string']); - - $DB->query("SELECT m.*, f.id as forum_id, f.name FROM ibf_moderator_logs m, ibf_forums f WHERE $dbq AND f.id=m.forum_id ORDER BY m.ctime DESC LIMIT $start, 20"); - - - - } - - $links = $std->build_pagelinks( array( 'TOTAL_POSS' => $row_count, - 'PER_PAGE' => 20, - 'CUR_ST_VAL' => $start, - 'L_SINGLE' => "Single Page", - 'L_MULTI' => "Pages: ", - 'BASE_URL' => $ADMIN->base_url.$query, - ) - ); - - $ADMIN->page_detail = "You may view and remove actions performed by your moderators"; - $ADMIN->page_title = "Moderator Logs Manager"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Member Name" , "15%" ); - $SKIN->td_header[] = array( "Action Perfomed" , "15%" ); - $SKIN->td_header[] = array( "Forum" , "15%" ); - $SKIN->td_header[] = array( "Topic Title" , "25%" ); - $SKIN->td_header[] = array( "Time of action" , "20%" ); - $SKIN->td_header[] = array( "IP address" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Saved Moderator Logs" ); - $ADMIN->html .= $SKIN->add_td_basic($links, 'center', 'catrow'); - - if ( $DB->get_num_rows() ) - { - while ( $row = $DB->fetch_row() ) - { - - $row['ctime'] = $std->get_date( $row['ctime'], 'LONG' ); - - $sess_id = preg_replace( "/^.+?s=(\w{32}).+?$/" , "\\1", $row['http_referer'] ); - $row['http_referer'] = preg_replace( "/s=(\w){32}/" , "" , $row['http_referer'] ); - - $ADMIN->html .= $SKIN->add_td_row( array( "{$row['member_name']}", - "{$row['action']}", - "{$row['name']}", - "{$row['topic_title']}", - "{$row['ctime']}", - "{$row['ip_address']}", - ) ); - - - } - } - else - { - $ADMIN->html .= $SKIN->add_td_basic("
    No results
    "); - } - - $ADMIN->html .= $SKIN->add_td_basic($links, 'center', 'tdtop'); - - $ADMIN->html .= $SKIN->end_table(); - - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - //--------------------------------------------- - // Remove archived files - //--------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['mid'] == "") - { - $ADMIN->error("You did not select a member ID to remove by!"); - } - - $DB->query("DELETE FROM ibf_moderator_logs WHERE member_id='".$IN['mid']."'"); - - $std->boink_it($ADMIN->base_url."&act=modlog"); - exit(); - - - } - - - - - - //------------------------------------------------------------- - // SHOW ALL LANGUAGE PACKS - //------------------------------------------------------------- - - function list_current() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - - $ADMIN->page_detail = "You may view and remove actions performed by your moderators"; - $ADMIN->page_title = "Moderator Logs Manager"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Member Name" , "30%" ); - $SKIN->td_header[] = array( "Actions Perfomed" , "20%" ); - $SKIN->td_header[] = array( "View all by member" , "20%" ); - $SKIN->td_header[] = array( "Remove all by member" , "30%" ); - - $ADMIN->html .= $SKIN->start_table( "Saved Moderator Logs" ); - - $DB->query("SELECT m.*, count(m.id) as act_count from ibf_moderator_logs m GROUP BY m.member_id ORDER BY act_count DESC"); - - while ( $r = $DB->fetch_row() ) - { - - $ADMIN->html .= $SKIN->add_td_row( array( "{$r['member_name']}", - "
    {$r['act_count']}
    ", - "
    View
    ", - "
    Remove
    ", - ) ); - } - - - - $ADMIN->html .= $SKIN->end_table(); - - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'view' ), - 2 => array( 'act' , 'modlog' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Search Moderator Logs" ); - - $form_array = array( - 0 => array( 'topic_title', 'Topic Title' ), - 1 => array( 'ip_address', 'IP Address' ), - 2 => array( 'member_name', 'Member Name' ), - 3 => array( 'topic_id' , 'Topic ID' ), - 4 => array( 'forum_id' , 'Forum ID' ) - ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Search for..." , - $SKIN->form_input( "search_string") - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Search in..." , - $SKIN->form_dropdown( "search_type", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Search"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - - -} - - + Import functions +| > Module written by Matt Mecham +| > Date started: 22nd April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +// Ensure we've not accessed this script directly: + + + +$idx = new ad_modlogs(); + + +class ad_modlogs { + + var $base_url; + + function ad_modlogs() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + + case 'view': + $this->view(); + break; + + case 'remove': + $this->remove(); + break; + + + //------------------------- + default: + $this->list_current(); + break; + } + + } + + //--------------------------------------------- + // Remove archived files + //--------------------------------------------- + + function view() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $start = $IN['st'] ? $IN['st'] : 0; + + $ADMIN->page_detail = "Viewing all actions by a moderator"; + $ADMIN->page_title = "Moderator Logs Manager"; + + if ($IN['search_string'] == "") + { + $DB->query("SELECT COUNT(id) as count FROM ibf_moderator_logs WHERE member_id='".$IN['mid']."'"); + $row = $DB->fetch_row(); + + $row_count = $row['count']; + + $query = "&act=modlog&mid={$IN['mid']}&code=view"; + + $DB->query("SELECT m.*, f.id as forum_id, f.name FROM ibf_moderator_logs m, ibf_forums f WHERE m.member_id='".$IN['mid']."' AND f.id=m.forum_id ORDER BY m.ctime DESC LIMIT $start, 20"); + + } + else + { + $IN['search_string'] = urldecode($IN['search_string']); + + if ( ($IN['search_type'] == 'topic_id') or ($IN['search_type'] == 'forum_id') ) + { + $dbq = "m.".$IN['search_type']."='".$IN['search_string']."'"; + } + else + { + $dbq = "m.".$IN['search_type']." LIKE '%".$IN['search_string']."%'"; + } + + $DB->query("SELECT COUNT(m.id) as count FROM ibf_moderator_logs m WHERE $dbq"); + $row = $DB->fetch_row(); + + $row_count = $row['count']; + + $query = "&act=modlog&code=view&search_type={$IN['search_type']}&search_string=".urlencode($IN['search_string']); + + $DB->query("SELECT m.*, f.id as forum_id, f.name FROM ibf_moderator_logs m, ibf_forums f WHERE $dbq AND f.id=m.forum_id ORDER BY m.ctime DESC LIMIT $start, 20"); + + + + } + + $links = $std->build_pagelinks( array( 'TOTAL_POSS' => $row_count, + 'PER_PAGE' => 20, + 'CUR_ST_VAL' => $start, + 'L_SINGLE' => "Single Page", + 'L_MULTI' => "Pages: ", + 'BASE_URL' => $ADMIN->base_url.$query, + ) + ); + + $ADMIN->page_detail = "You may view and remove actions performed by your moderators"; + $ADMIN->page_title = "Moderator Logs Manager"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Member Name" , "15%" ); + $SKIN->td_header[] = array( "Action Perfomed" , "15%" ); + $SKIN->td_header[] = array( "Forum" , "15%" ); + $SKIN->td_header[] = array( "Topic Title" , "25%" ); + $SKIN->td_header[] = array( "Time of action" , "20%" ); + $SKIN->td_header[] = array( "IP address" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Saved Moderator Logs" ); + $ADMIN->html .= $SKIN->add_td_basic($links, 'center', 'catrow'); + + if ( $DB->get_num_rows() ) + { + while ( $row = $DB->fetch_row() ) + { + + $row['ctime'] = $std->get_date( $row['ctime'], 'LONG' ); + + $sess_id = preg_replace( "/^.+?s=(\w{32}).+?$/" , "\\1", $row['http_referer'] ); + $row['http_referer'] = preg_replace( "/s=(\w){32}/" , "" , $row['http_referer'] ); + + $ADMIN->html .= $SKIN->add_td_row( array( "{$row['member_name']}", + "{$row['action']}", + "{$row['name']}", + "{$row['topic_title']}", + "{$row['ctime']}", + "{$row['ip_address']}", + ) ); + + + } + } + else + { + $ADMIN->html .= $SKIN->add_td_basic("
    No results
    "); + } + + $ADMIN->html .= $SKIN->add_td_basic($links, 'center', 'tdtop'); + + $ADMIN->html .= $SKIN->end_table(); + + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + //--------------------------------------------- + // Remove archived files + //--------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['mid'] == "") + { + $ADMIN->error("You did not select a member ID to remove by!"); + } + + $DB->query("DELETE FROM ibf_moderator_logs WHERE member_id='".$IN['mid']."'"); + + $ADMIN->save_log("Removed Moderator Logs"); + + $std->boink_it($ADMIN->base_url."&act=modlog"); + exit(); + + + } + + + + + + //------------------------------------------------------------- + // SHOW ALL LANGUAGE PACKS + //------------------------------------------------------------- + + function list_current() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + + $ADMIN->page_detail = "You may view and remove actions performed by your moderators"; + $ADMIN->page_title = "Moderator Logs Manager"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Member Name" , "30%" ); + $SKIN->td_header[] = array( "Actions Perfomed" , "20%" ); + $SKIN->td_header[] = array( "View all by member" , "20%" ); + $SKIN->td_header[] = array( "Remove all by member" , "30%" ); + + $ADMIN->html .= $SKIN->start_table( "Saved Moderator Logs" ); + + $DB->query("SELECT m.*, count(m.id) as act_count from ibf_moderator_logs m GROUP BY m.member_id ORDER BY act_count DESC"); + + while ( $r = $DB->fetch_row() ) + { + + $ADMIN->html .= $SKIN->add_td_row( array( "{$r['member_name']}", + "
    {$r['act_count']}
    ", + "
    View
    ", + "
    Remove
    ", + ) ); + } + + + + $ADMIN->html .= $SKIN->end_table(); + + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'view' ), + 2 => array( 'act' , 'modlog' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Search Moderator Logs" ); + + $form_array = array( + 0 => array( 'topic_title', 'Topic Title' ), + 1 => array( 'ip_address', 'IP Address' ), + 2 => array( 'member_name', 'Member Name' ), + 3 => array( 'topic_id' , 'Topic ID' ), + 4 => array( 'forum_id' , 'Forum ID' ) + ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Search for..." , + $SKIN->form_input( "search_string") + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Search in..." , + $SKIN->form_dropdown( "search_type", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Search"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_mysql.php b/upload/sources/Admin/ad_mysql.php new file mode 100644 index 00000000..54915b0a --- /dev/null +++ b/upload/sources/Admin/ad_mysql.php @@ -0,0 +1,985 @@ + mySQL Admin Stuff +| > Module written by Matt Mecham +| > Date started: 21st October 2002 +| +| > Module Version Number: 1.0.0 +| > Music listen to when coding this: Martin Grech - Open Heart Zoo +| > Talk about useless information! ++-------------------------------------------------------------------------- +*/ + + +// Ensure we've not accessed this script directly: + +@set_time_limit(1200); + +$idx = new ad_mysql(); + + +class ad_mysql { + + var $base_url; + var $mysql_version = ""; + var $true_version = ""; + var $str_gzip_header = "\x1f\x8b\x08\x00\x00\x00\x00\x00"; + + function ad_mysql() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS, $HTTP_GET_VARS; + + // Make sure we're a root admin, or else! + + if ($MEMBER['mgroup'] != $INFO['admin_group']) + { + $ADMIN->error("Sorry, these functions are for the root admin group only"); + } + + //--------------------------------------- + // Get the mySQL version. + // Adapted from phpMyAdmin + //--------------------------------------- + + $DB->query("SELECT VERSION() AS version"); + + if ( ! $row = $DB->fetch_row() ) + { + $DB->query("SHOW VARIABLES LIKE 'version'"); + $row = $DB->fetch_row(); + } + + $this->true_version = $row['version']; + + $no_array = explode( '.', preg_replace( "/^(.+?)[-_]?/", "\\1", $row['version']) ); + + $one = (!isset($no_array) || !isset($no_array[0])) ? 3 : $no_array[0]; + $two = (!isset($no_array[1])) ? 21 : $no_array[1]; + $three = (!isset($no_array[2])) ? 0 : $no_array[2]; + + $this->mysql_version = (int)sprintf('%d%02d%02d', $one, $two, intval($three)); + + switch($IN['code']) + { + + case 'dotool': + $this->run_tool(); + break; + + case 'runtime': + $this->view_sql("SHOW STATUS"); + break; + + case 'system': + $this->view_sql("SHOW VARIABLES"); + break; + + case 'processes': + $this->view_sql("SHOW PROCESSLIST"); + break; + + case 'runsql': + $q = $HTTP_POST_VARS['query'] == "" ? $HTTP_GET_VARS['query'] : $HTTP_POST_VARS['query']; + $this->view_sql(trim(urldecode(stripslashes($q)))); + break; + + case 'backup': + $this->show_backup_form(); + break; + + case 'safebackup': + $this->sbup_splash(); + break; + + case 'dosafebackup': + $this->do_safe_backup(); + break; + + case 'export_tbl': + $this->do_safe_backup(trim(urldecode(stripslashes($HTTP_GET_VARS['tbl'])))); + break; + + //------------------------- + default: + $this->list_index(); + break; + } + + } + + //----------------------------------------------- + // Back up baby, back up + //----------------------------------------------- + + function do_safe_backup($tbl_name="") + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($tbl_name == "") + { + // Auto all tables + $skip = intval($IN['skip']); + $create_tbl = intval($IN['create_tbl']); + $enable_gzip = intval($IN['enable_gzip']); + $filename = 'ibf_dbbackup'; + } + else + { + // Man. click export + + $skip = 0; + $create_tbl = 0; + $enable_gzip = 1; + $filename = $tbl_name; + } + + $output = ""; + + @header("Pragma: no-cache"); + + $do_gzip = 0; + + if( $enable_gzip ) + { + $phpver = phpversion(); + + if($phpver >= "4.0") + { + if(extension_loaded("zlib")) + { + $do_gzip = 1; + } + } + } + + if( $do_gzip != 0 ) + { + @ob_start(); + @ob_implicit_flush(0); + header("Content-Type: text/x-delimtext; name=\"$filename.sql.gz\""); + header("Content-disposition: attachment; filename=$filename.sql.gz"); + } + else + { + header("Content-Type: text/x-delimtext; name=\"$filename.sql\""); + header("Content-disposition: attachment; filename=$filename.sql"); + } + + //----------------------------- + // Get tables to work on + //----------------------------- + + if ($tbl_name == "") + { + $tmp_tbl = $DB->get_table_names(); + + foreach($tmp_tbl as $tbl) + { + // Ensure that we're only peeking at IBF tables + + if ( preg_match( "/^".$INFO['sql_tbl_prefix']."/", $tbl ) ) + { + // We've started our headers, so print as we go to stop + // poss memory problems + + $this->get_table_sql($tbl, $create_tbl, $skip); + } + } + } + else + { + $this->get_table_sql($tbl_name, $create_tbl, $skip); + } + + //----------------------------- + // GZIP? + //----------------------------- + + if($do_gzip) + { + $size = ob_get_length(); + $crc = crc32(ob_get_contents()); + $contents = gzcompress(ob_get_contents()); + ob_end_clean(); + echo $this->str_gzip_header + .substr($contents, 0, strlen($contents) - 4) + .$this->gzip_four_chars($crc) + .$this->gzip_four_chars($size); + } + + exit(); + + } + + //----------------------------------------------- + // Internal handler to return content from table + //----------------------------------------------- + + function get_table_sql($tbl, $create_tbl, $skip=0) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($create_tbl) + { + // Generate table structure + + $DB->query("SHOW CREATE TABLE ".$INFO['sql_database'].".".$tbl); + + $ctable = $DB->fetch_row(); + + echo $this->sql_strip_ticks($ctable['Create Table']).";\n"; + } + + // Are we skipping? Woohoo, where's me rope?! + + if ($skip == 1) + { + if ($tbl == $INFO['sql_database'].'admin_sessions' + OR $tbl == $INFO['sql_database'].'sessions' + OR $tbl == $INFO['sql_database'].'reg_anti_spam' + OR $tbl == $INFO['sql_database'].'search_results' + ) + { + return $ret; + } + } + + // Get the data + + $DB->query("SELECT * FROM $tbl"); + + // Check to make sure rows are in this + // table, if not return. + + $row_count = $DB->get_num_rows(); + + if ($row_count < 1) + { + return TRUE; + } + + //--------------------------- + // Get col names + //--------------------------- + + $f_list = ""; + + $fields = $DB->get_result_fields(); + + $cnt = count($fields); + + for( $i = 0; $i < $cnt; $i++ ) + { + $f_list .= $fields[$i]->name . ", "; + } + + $f_list = preg_replace( "/, $/", "", $f_list ); + + while ( $row = $DB->fetch_row() ) + { + //--------------------------- + // Get col data + //--------------------------- + + $d_list = ""; + + for( $i = 0; $i < $cnt; $i++ ) + { + if ( ! isset($row[ $fields[$i]->name ]) ) + { + $d_list .= "NULL,"; + } + elseif ( $row[ $fields[$i]->name ] != '' ) + { + $d_list .= "'".$this->sql_add_slashes($row[ $fields[$i]->name ]). "',"; + } + else + { + $d_list .= "'',"; + } + } + + $d_list = preg_replace( "/,$/", "", $d_list ); + + echo "INSERT INTO $tbl ($f_list) VALUES($d_list);\n"; + } + + return TRUE; + + } + + //----------------------------------------------- + // sql_strip_ticks from field names + //----------------------------------------------- + + function sql_strip_ticks($data) + { + return str_replace( "`", "", $data ); + } + + //----------------------------------------------- + // Add slashes to single quotes to stop sql breaks + //----------------------------------------------- + + function sql_add_slashes($data) + { + $data = str_replace('\\', '\\\\', $data); + $data = str_replace('\'', '\\\'', $data); + $data = str_replace("\r", '\r' , $data); + $data = str_replace("\n", '\n' , $data); + + return $data; + } + + //----------------------------------------------- + // Almost there! + //----------------------------------------------- + + function sbup_splash() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "This section allows you to backup your database."; + + $ADMIN->page_title = "mySQL ".$this->true_version." Back Up"; + + // Check for mySQL version.. + // Might change at some point.. + + if ( $this->mysql_version < 32321 ) + { + $ADMIN->error("Sorry, mySQL version of less than 3.23.21 are not support by this backup utility"); + } + + $SKIN->td_header[] = array( " " , "100%" ); + + $ADMIN->html .= $SKIN->start_table( "Simple Back Up" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Back Up mySQL Database

    Once you have clicked the link below, please wait + until your browser prompts you with a dialogue box. This may take some time depending on + the size of the database you are backing up. +

    + Click here to start the backup" + ) ); + + + $ADMIN->html .= $SKIN->end_table(); + + + $ADMIN->output(); + + + } + + + function show_backup_form() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "This section allows you to backup your database. +

    Simple Backup +
    This function compiles a single back up file and prompts a browser dialogue box for you to save + the file. This is beneficial for PHP safe mode enabled hosts, but can only be used on small databases. + "; + + $ADMIN->page_title = "mySQL ".$this->true_version." Back Up"; + + // Check for mySQL version.. + // Might change at some point.. + + if ( $this->mysql_version < 32321 ) + { + $ADMIN->error("Sorry, mySQL version of less than 3.23.21 are not support by this backup utility"); + } + + $SKIN->td_header[] = array( " " , "60%" ); + $SKIN->td_header[] = array( " " , "40%" ); + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'act' , 'mysql' ), + 2 => array( 'code' , 'safebackup'), + ) ); + + $ADMIN->html .= $SKIN->start_table( "Simple Back Up" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Add 'CREATE TABLE' statements?", + $SKIN->form_yes_no( 'create_tbl', 1), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Skip non essential data?
    Will not produce insert rows for ibf_sessions, ibf_admin_sessions, ibf_search_results, ibf_reg_anti_spam.", + $SKIN->form_yes_no( 'skip', 1), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "GZIP Content?
    Will produce a smaller file if GZIP is enabled.", + $SKIN->form_yes_no( 'enable_gzip', 1), + ) ); + + $ADMIN->html .= $SKIN->end_form("Start Back Up"); + $ADMIN->html .= $SKIN->end_table(); + + + $ADMIN->output(); + + + } + + + + //------------------------- + // Run mySQL queries + //------------------------- + + + function view_sql($sql) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $limit = 50; + $start = intval($IN['st']) == "" ? 0 : intval($IN['st']); + $pages = ""; + + $ADMIN->page_detail = "This section allows you to administrate your mySQL database.$extra"; + $ADMIN->page_title = "mySQL ".$this->true_version." Tool Box"; + + $map = array( 'processes' => "SQL Processes", + 'runtime' => "SQL Runtime Information", + 'system' => "SQL System Variables", + ); + + if ($map[ $IN['code'] ] != "") + { + $tbl_title = $map[ $IN['code'] ]; + $man_query = 0; + } + else + { + $tbl_title = "Manual Query"; + $man_query = 1; + } + + //------------------------------------------------ + + if ($man_query == 1) + { + $SKIN->td_header[] = array( " " , "100%" ); + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'act' , 'mysql' ), + 2 => array( 'code' , 'runsql'), + ) ); + + $ADMIN->html .= $SKIN->start_table( "Run Query" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "
    ".$SKIN->form_textarea("query", $sql )."
    " ) ); + + $ADMIN->html .= $SKIN->end_form("Run a New Query"); + $ADMIN->html .= $SKIN->end_table(); + + + // Check for drop, create and flush + + if ( preg_match( "/^DROP|CREATE|FLUSH/i", trim($sql) ) ) + { + $ADMIN->error = "Sorry, those queries are not allowed for your safety"; + } + } + + //------------------------------------------------ + + $DB->return_die = 1; + + $DB->query($sql); + + // Check for errors.. + + if ( $DB->error != "") + { + $SKIN->td_header[] = array( " " , "100%" ); + + $ADMIN->html .= $SKIN->start_table( "SQL Error" ); + + $ADMIN->html .= $SKIN->add_td_row( array($DB->error) ); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); // End output and script + + } + + if ( preg_match( "/^INSERT|UPDATE|DELETE|ALTER/i", trim($sql) ) ) + { + // We can't show any info, and if we're here, there isn't + // an error, so we're good to go. + + $SKIN->td_header[] = array( " " , "100%" ); + + $ADMIN->html .= $SKIN->start_table( "SQL Query Completed" ); + + $ADMIN->html .= $SKIN->add_td_row( array("Query: $sql
    Executed Successfully") ); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); // End output and script + + } + else if ( preg_match( "/^SELECT/i", $sql ) ) + { + // Sort out the pages and stuff + // auto limit if need be + + if ( ! preg_match( "/LIMIT[ 0-9,]+$/i", $sql ) ) + { + $rows_returned = $DB->get_num_rows(); + + if ($rows_returned > $limit) + { + // Get tbl name + + //$tbl_name = preg_replace( "/(".$INFO['sql_tbl_prefix']."\S+?)([\s\.,]|$)/i", "\\1", $sql ); + + // Set up pages. + + $links = $std->build_pagelinks( array( 'TOTAL_POSS' => $rows_returned, + 'PER_PAGE' => $limit, + 'CUR_ST_VAL' => $start, + 'L_SINGLE' => "Single Page", + 'L_MULTI' => "Pages: ", + 'BASE_URL' => $ADMIN->base_url."&act=mysql&code=runsql&query=".urlencode($sql), + ) + ); + + $sql .= " LIMIT $start, $limit"; + + // Re-run with limit + + $DB->query($sql); + } + } + + } + + $fields = $DB->get_result_fields(); + + $cnt = count($fields); + + // Print the headers - we don't what or how many so... + + for( $i = 0; $i < $cnt; $i++ ) + { + $SKIN->td_header[] = array( $fields[$i]->name , "*" ); + } + + $ADMIN->html .= $SKIN->start_table( "Result: ".$tbl_title ); + + if ($links != "") + { + $pages = $SKIN->add_td_basic( $links, 'left', 'tdrow2' ); + + $ADMIN->html .= $pages; + } + + while( $r = $DB->fetch_row() ) + { + + // Grab the rows - we don't what or how many so... + + $rows = array(); + + for( $i = 0; $i < $cnt; $i++ ) + { + if ($man_query == 1) + { + // Limit output + if ( strlen($r[ $fields[$i]->name ]) > 200 ) + { + $r[ $fields[$i]->name ] = substr($r[ $fields[$i]->name ], 0, 200) .'...'; + } + } + + $rows[] = wordwrap( htmlspecialchars(nl2br($r[ $fields[$i]->name ])) , 50, "
    ", 1 ); + } + + $ADMIN->html .= $SKIN->add_td_row( $rows ); + + } + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $ADMIN->output(); + + + } + + //------------------------------------------------------------- + // I'm A TOOL! + //------------------------------------------------------------- + + function run_tool() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "This section allows you to administrate your mySQL database.$extra"; + $ADMIN->page_title = "mySQL ".$this->true_version." Tool Box"; + + //------------------------------------------------------------- + // have we got some there tables me laddo? + //------------------------------------------------------------- + + $tables = array(); + + foreach ($IN as $key => $value) + { + if ( preg_match( "/^tbl_(\S+)$/", $key, $match ) ) + { + if ($IN[$match[0]]) + { + $tables[] = $match[1]; + } + } + } + + if ( count($tables) < 1 ) + { + $ADMIN->error("You must choose some tables to run this tool on or it's just plain outright silly"); + } + + //------------------------------------------------------------- + // What tool is one running? + // optimize analyze check repair + //------------------------------------------------------------- + + if (strtoupper($IN['tool']) == 'DROP' || strtoupper($IN['tool']) == 'CREATE' || strtoupper($IN['tool']) == 'FLUSH') + { + $ADMIN->error("You can't do that, sorry"); + } + + foreach($tables as $table) + { + $DB->query(strtoupper($IN['tool'])." TABLE $table"); + + $fields = $DB->get_result_fields(); + + $data = $DB->fetch_row(); + + $cnt = count($fields); + + // Print the headers - we don't what or how many so... + + for( $i = 0; $i < $cnt; $i++ ) + { + $SKIN->td_header[] = array( $fields[$i]->name , "*" ); + } + + $ADMIN->html .= $SKIN->start_table( "Result: ".$IN['tool']." ".$table ); + + // Grab the rows - we don't what or how many so... + + $rows = array(); + + for( $i = 0; $i < $cnt; $i++ ) + { + $rows[] = $data[ $fields[$i]->name ]; + } + + $ADMIN->html .= $SKIN->add_td_row( $rows ); + + $ADMIN->html .= $SKIN->end_table(); + } + + //+------------------------------- + + $ADMIN->output(); + + + } + + + //------------------------------------------------------------- + // SHOW ALL TABLES AND STUFF! + // 5 hours ago this seemed like a damned good idea. + // Now it's late and I want to replace all of this code with + // header("Location: http://yoursite/phpmyadmin"); + //------------------------------------------------------------- + + function list_index() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + + if ( $this->mysql_version < 32322 ) + { + $extra = "
    Note: your version of mySQL has a limited feature set and some tools have been removed"; + } + + $ADMIN->page_detail = "This section allows you to administrate your mySQL database.$extra"; + $ADMIN->page_title = "mySQL ".$this->true_version." Tool Box"; + + //+------------------------------- + // Show advanced stuff for mySQL > 3.23.03 + //+------------------------------- + + $idx_size = 0; + $tbl_size = 0; + + + $ADMIN->html .= " + + "; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'act' , 'mysql' ), + 2 => array( 'code' , 'dotool'), + ) , "theForm" ); + + if ( $this->mysql_version >= 32303 ) + { + + $SKIN->td_header[] = array( "Table" , "20%" ); + $SKIN->td_header[] = array( "Rows" , "10%" ); + $SKIN->td_header[] = array( "TBL Size" , "20%" ); + $SKIN->td_header[] = array( "Index Size" , "20%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( '' , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Invision Board Tables" ); + + $DB->query("SHOW TABLE STATUS FROM ".$INFO['sql_database']); + + while ( $r = $DB->fetch_row() ) + { + // Check to ensure it's a table for this install... + + if ( ! preg_match( "/^".$INFO['sql_tbl_prefix']."/", $r['Name'] ) ) + { + continue; + } + + $idx_size += $r['Index_length']; + $tbl_size += $r['Data_length']; + + $iBit = ($r['Index_length'] > 0) ? 1 : 0; + $tBit = ($r['Data_length'] > 0) ? 1 : 0; + + $idx = $this->gen_size( $r['Index_length'], 3, $iBit ); + $tbl = $this->gen_size( $r['Data_length'] , 3, $tBit ); + + $ADMIN->html .= $SKIN->add_td_row( array( "{$r['Name']}", + "
    {$r['Rows']}
    ", + "
    {$tbl[0]} {$tbl[1]}
    ", + "
    {$idx[0]} {$idx[1]}
    ", + "
    Export
    ", + "
    ", + ) ); + } + + $total = $idx_size + $tbl_size; + + $iBit = ($idx_size > 0) ? 1 : 0; + $tBit = ($tbl_size > 0) ? 1 : 0; + $oBit = ($total > 0) ? 1 : 0; + + $idx = $this->gen_size( $idx_size , 3, $iBit ); + $tbl = $this->gen_size( $tbl_size , 3, $tBit ); + $tot = $this->gen_size( $total , 3, $oBit ); + + $ADMIN->html .= $SKIN->add_td_row( array (" ", + "
    Totals ({$tot[0]} {$tot[1]})
    ", + "
    {$tbl[0]} {$tbl[1]}
    ", + "
    {$idx[0]} {$idx[1]}
    ", + " ", + ) ); + + } + else + { + // display a basic information table + + $SKIN->td_header[] = array( "Table" , "60%" ); + $SKIN->td_header[] = array( "Rows" , "30%" ); + $SKIN->td_header[] = array( '' , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Invision Board Tables" ); + + $tables = $DB->get_table_names(); + + foreach($tables as $tbl) + { + // Ensure that we're only peeking at IBF tables + + if ( ! preg_match( "/^".$INFO['sql_tbl_prefix']."/", $tbl ) ) + { + continue; + } + + $DB->query("SELECT COUNT(*) AS Rows FROM $tbl"); + + $cnt = $DB->fetch_row(); + + $ADMIN->html .= $SKIN->add_td_row( array( "$tbl", + "
    {$cnt['Rows']}
    ", + "
    ", + ) ); + + } + + } + + //---------------------------- + // Add in the bottom stuff + //---------------------------- + + if ( $this->mysql_version < 32322 ) + { + $ADMIN->html .= $SKIN->add_td_basic( " + ", "center", "tdrow2" ); + } + else + { + + $ADMIN->html .= $SKIN->add_td_basic( " + ", "center", "tdrow2" ); + } + + $ADMIN->html .= $SKIN->end_table(); + + + //---------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'act' , 'mysql' ), + 2 => array( 'code' , 'runsql'), + ) ); + + $SKIN->td_header[] = array( "Table" , "30%" ); + $SKIN->td_header[] = array( "Rows" , "70%" ); + + $ADMIN->html .= $SKIN->start_table( "Run a Query" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Manual Query
    Advanced Users Only", + $SKIN->form_textarea("query", "" ), + ) ); + + $ADMIN->html .= $SKIN->end_form("Run Query"); + $ADMIN->html .= $SKIN->end_table(); + + + //+------------------------------- + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // Convert chars into byte sizes + // (Based on a similar function in phpmyadmin) + // "Based on?" my ass! + // Ok, so I pretty much cut n' pasted it - but it's late and I + // have to get this done. + // I did make it pretty though - does that count? + // Oh CMON! A zillion lines of new code and you can't get over + // a few lines "borrowed" from another script? + //------------------------------------------------------------- + + function gen_size($val, $li, $sepa ) + { + $sep = pow(10, $sepa); + $li = pow(10, $li); + $retval = $val; + $unit = 'Bytes'; + + if ($val >= $li * 1000000) + { + $val = round( $val / (1073741824/$sep) ) / $sep; + $unit = 'GB'; + } + else if ($val >= $li*1000) + { + $val = round( $val / (1048576/$sep) ) / $sep; + $unit = 'MB'; + } + else if ($val >= $li) + { + $val = round( $val / (1024/$sep) ) / $sep; + $unit = 'KB'; + } + if ($unit != 'Bytes') + { + $retval = number_format($val, $sepa, '.', ','); + } + else + { + $retval = number_format($val, 0, '.', ','); + } + + return array($retval, $unit); + } + + function gzip_four_chars($val) + { + for ($i = 0; $i < 4; $i ++) + { + $return .= chr($val % 256); + $val = floor($val / 256); + } + return $return; + } + + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_profilefields.php b/upload/sources/Admin/ad_profilefields.php new file mode 100644 index 00000000..12b37ae1 --- /dev/null +++ b/upload/sources/Admin/ad_profilefields.php @@ -0,0 +1,442 @@ + Custom profile field functions +| > Module written by Matt Mecham +| > Date started: 24th June 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new ad_fields(); + + +class ad_fields { + + var $base_url; + + function ad_fields() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'add': + $this->main_form('add'); + break; + + case 'doadd': + $this->main_save('add'); + break; + + case 'edit': + $this->main_form('edit'); + break; + + case 'doedit': + $this->main_save('edit'); + break; + + case 'delete': + $this->delete_form(); + break; + + case 'dodelete': + $this->do_delete(); + break; + + default: + $this->main_screen(); + break; + } + + } + + + + //+--------------------------------------------------------------------------------- + // + // Delete a group + // + //+--------------------------------------------------------------------------------- + + function delete_form() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the group ID, please try again"); + } + + $ADMIN->page_title = "Deleting a Custom Profile Field"; + + $ADMIN->page_detail = "Please check to ensure that you are attempting to remove the correct custom profile field as all data will be lost!."; + + + //+------------------------------- + + $DB->query("SELECT ftitle, fid FROM ibf_pfields_data WHERE fid='".$IN['id']."'"); + + if ( ! $field = $DB->fetch_row() ) + { + $ADMIN->error("Could not fetch the row from the database"); + } + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'dodelete' ), + 2 => array( 'act' , 'field' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Removal Confirmation" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Custom Profile field to remove" , + "".$field['ftitle']."", + ) ); + + $ADMIN->html .= $SKIN->end_form("Delete this custom field"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + function do_delete() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the field ID, please try again"); + } + + + // Check to make sure that the relevant groups exist. + + $DB->query("SELECT ftitle, fid FROM ibf_pfields_data WHERE fid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not resolve the ID's passed to deletion"); + } + + $DB->query("ALTER TABLE ibf_pfields_content DROP field_{$row['fid']}"); + + $DB->query("DELETE FROM ibf_pfields_data WHERE fid='".$IN['id']."'"); + + $ADMIN->done_screen("Profile Field Removed", "Custom Profile Field Control", "act=field" ); + + } + + + //+--------------------------------------------------------------------------------- + // + // Save changes to DB + // + //+--------------------------------------------------------------------------------- + + function main_save($type='edit') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['ftitle'] == "") + { + $ADMIN->error("You must enter a field title."); + } + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("Could not resolve the field id"); + } + + } + + $content = ""; + + if ($HTTP_POST_VARS['fcontent'] != "") + { + $content = str_replace( "\n", '|', str_replace( "\n\n", "\n", trim($HTTP_POST_VARS['fcontent']) ) ); + } + + $db_string = array( 'ftitle' => $IN['ftitle'], + 'fdesc' => $IN['fdesc'], + 'fcontent' => stripslashes($content), + 'ftype' => $IN['ftype'], + 'freq' => $IN['freq'], + 'fhide' => $IN['fhide'], + 'fmaxinput' => $IN['fmaxinput'], + 'fedit' => $IN['fedit'], + 'forder' => $IN['forder'], + 'fshowreg' => $IN['fshowreg'], + ); + + + if ($type == 'edit') + { + $rstring = $DB->compile_db_update_string( $db_string ); + + $DB->query("UPDATE ibf_pfields_data SET $rstring WHERE fid='".$IN['id']."'"); + + $ADMIN->done_screen("Profile Field Edited", "Custom Profile Field Control", "act=field" ); + + } + else + { + $rstring = $DB->compile_db_insert_string( $db_string ); + + $DB->query("INSERT INTO ibf_pfields_data (" .$rstring['FIELD_NAMES']. ") VALUES (". $rstring['FIELD_VALUES'] .")"); + + $new_id = $DB->get_insert_id(); + + $DB->query("ALTER TABLE ibf_pfields_content ADD field_$new_id text default ''"); + + $DB->query("OPTIMIZE TABLE ibf_pfields_content"); + + $ADMIN->done_screen("Profile Field Added", "Custom Profile Field Control", "act=field" ); + } + } + + + //+--------------------------------------------------------------------------------- + // + // Add / edit group + // + //+--------------------------------------------------------------------------------- + + function main_form($type='edit') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("No group id to select from the database, please try again."); + } + + $form_code = 'doedit'; + $button = 'Complete Edit'; + + } + else + { + $form_code = 'doadd'; + $button = 'Add Field'; + } + + if ($IN['id'] != "") + { + $DB->query("SELECT * FROM ibf_pfields_data WHERE fid='".$IN['id']."'"); + $fields = $DB->fetch_row(); + } + else + { + $fields = array(); + } + + if ($type == 'edit') + { + $ADMIN->page_title = "Editing Profile Field ".$fields['ftitle']; + } + else + { + $ADMIN->page_title = 'Adding a new profile field'; + $fields['ftitle'] = ''; + } + + $ADMIN->page_detail = "Please double check the information before submitting the form."; + + + + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), + 2 => array( 'act' , 'field' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + $fields['fcontent'] = str_replace( '|', "\n", $fields['fcontent'] ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Field Settings" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Field Title
    Max characters: 200" , + $SKIN->form_input("ftitle", $fields['ftitle'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Description
    Max Characters: 250
    Can be used to note hidden/required status" , + $SKIN->form_input("fdesc", $fields['fdesc'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Field Type" , + $SKIN->form_dropdown("ftype", + array( + 0 => array( 'text' , 'Text Input' ), + 1 => array( 'drop' , 'Drop Down Box' ), + 2 => array( 'area' , 'Text Area' ), + ), + $fields['ftype'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max Input (for text input and text areas) in characters" , + $SKIN->form_input("fmaxinput", $fields['fmaxinput'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Display order (when editing and displaying) numeric 1 lowest." , + $SKIN->form_input("forder", $fields['forder'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Option Content (for drop downs)
    In sets, one set per line
    Example for 'Gender' field:
    m=Male
    f=Female
    u=Not Telling
    Will produce:

    m,f or u stored in database. When showing field in profile, will use value from pair (f=Female, shows 'Female')" , + $SKIN->form_textarea("fcontent", $fields['fcontent'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show on registration page also?" , + $SKIN->form_yes_no("fshowreg", $fields["fshowreg"] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Field cannot be left blank?
    (Will not apply if you choose to hide below)" , + $SKIN->form_yes_no("freq", $fields['freq'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Hidden to profile viewers?
    If yes, only admins and super mods can see it, user can still edit." , + $SKIN->form_yes_no("fhide", $fields['fhide'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Editable by user?
    If no, user cannot edit information, field can only be seen by admins and super mods. Admins can edit information via ACP" , + $SKIN->form_yes_no("fedit", $fields['fedit'] ) + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + // + // Show "Management Screen + // + //+--------------------------------------------------------------------------------- + + function main_screen() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Custom Profile Fields"; + + $ADMIN->page_detail = "Custom Profile fields can be used to add optional or required fields to be completed when registering or editing a profile. This is useful if you wish to record data from your members that is not already present in the base board."; + + $SKIN->td_header[] = array( "Field Title" , "30%" ); + $SKIN->td_header[] = array( "Type" , "20%" ); + $SKIN->td_header[] = array( "REQUIRED" , "10%" ); + $SKIN->td_header[] = array( "HIDDEN" , "10%" ); + $SKIN->td_header[] = array( "SHOW REG" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Delete" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Custom Profile Field Management" ); + + $real_types = array( 'drop' => 'Drop Down Box', + 'area' => 'Text Area', + 'text' => 'Text Input', + ); + + $DB->query("SELECT * FROM ibf_pfields_data"); + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + + $hide = ' '; + $req = ' '; + $regi = ' '; + + "
    Delete
    "; + + //----------------------------------- + if ($r['fhide'] == 1) + { + $hide = '
    Y
    '; + } + //----------------------------------- + if ($r['freq'] == 1) + { + $req = '
    Y
    '; + } + + if ($r['fshowreg'] == 1) + { + $regi = '
    Y
    '; + } + + + $ADMIN->html .= $SKIN->add_td_row( array( "{$r['ftitle']}" , + "
    {$real_types[$r['ftype']]}
    ", + $req, + $hide, + $regi, + "
    Edit
    ", + "
    Delete
    ", + ) ); + + } + } + else + { + $ADMIN->html .= $SKIN->add_td_basic("None found", "center", "tdrow2"); + } + + $ADMIN->html .= $SKIN->add_td_basic("ADD NEW FIELD", "center", "title"); + + $ADMIN->html .= $SKIN->end_table(); + + + $ADMIN->output(); + + + } + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_quickhelp.php b/upload/sources/Admin/ad_quickhelp.php new file mode 100644 index 00000000..b43462f1 --- /dev/null +++ b/upload/sources/Admin/ad_quickhelp.php @@ -0,0 +1,110 @@ + Admin Quick Help System +| > Module written by Matt Mecham +| > Date started: 1st march 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new quick_help(); + + +class quick_help { + + var $help_text = array(); + + function init_help_array() + { + + return array( + 'mg_promote' => array( 'title' => "Group Promotion", + 'body' => "If enabled (by choosing a member group to promote your members to and by entering a number of posts to achieve this) + when your members meet or exceed the number of posts set they will be 'promoted' to the specified group. +

    + Many administrators use this feature to set up a 'Senior Members' group with more functionality (such as a longer edit time, larger post uploads) and even + allow access to otherwise hidden forums - when your members have made enough posts, they are promoted to this group allowing you to intice more posting and + allow for a more restrictive set of permissions for newcomers. +

    Warning!
    Use this feature carefully and always check the information before proceeding.
    It is possible to advance to an Admin group - you have been warned. + ", + ), + 's_reg_antispam' => array ( 'title' => "Registration AntiSpam", + 'body' => "To prevent robots from registering (such as a malicious denial of service attack registering thousands of new accounts and forcing thousands of emails to be sent from your server) + you can enable this option. +

    When enabled, a random 6 digit numerical string is generated and shown in a graphical format (to prevent advanced bots from reading the source page). The user must enter + this string exactly when registering or the account will not be created.", + ), + + 'm_bulkemail' => array ( 'title' => "Bulk Emailing", + 'body' => "Overview
    Bulk emailing allows you to target a specific section of your community or email all your registered members. +

    Settings
    You can choose which user groups will receive the email and elect to override the user set 'Allow Admin Emails' function. It is NOT recommended that you do override this + however.
    + Allowed Tags
    Although the email system sends the mail via BCC to preserve system resources, you can add in dynamic content with the following tags. +
    {board_name} will return the name of your board +
    {reg_total} will return the total number of registered members +
    {total_posts} will return the total number of posts +
    {busy_count} will return the most number of online users +
    {busy_time} will return the date of the most online users +
    {board_url} will return the URL to the board +

    As the email is sent via BCC, it is not possible to include the members username, password or other user profile data.", + ), + ); + + } + + function quick_help() { + global $DB, $IN, $INFO, $ADMIN, $SKIN, $std; + + $id = $IN['id']; + + $this->help_text = $this->init_help_array(); + + if ($this->help_text[$id]['title'] == "") + { + $ADMIN->error("No help information is available for this function at present"); + } + + print " + + Quick Help + + + + + + + + + +
    {$this->help_text[$id]['title']}
    {$this->help_text[$id]['body']}
    + + "; + + + exit(); + + } + + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_remote_template.php b/upload/sources/Admin/ad_remote_template.php new file mode 100644 index 00000000..0bbd7094 --- /dev/null +++ b/upload/sources/Admin/ad_remote_template.php @@ -0,0 +1,853 @@ + Skin -> Templates pop up functions +| > Module written by Matt Mecham +| > Date started: 9th July 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'preview': + $this->do_preview(); + break; + + case 'edit_bit': + $this->edit_bit(); + break; + + case 'macro_one': + $this->macro_one(); + break; + + case 'macro_two': + $this->macro_two(); + break; + + case 'compare': + $this->compare_frames(); + break; + + case 'dotop': + $this->print_compare_top(); + break; + + case 'donew': + $this->print_compare_new(); + break; + + //----------------------------- + + case 'search': + $this->search_frames(); + break; + + case 'searchbox': + $this->print_search_box(); + break; + + case 'searchlinks': + $this->print_searchlinks(); + break; + + //----------------------------- + + case 'css_search': + $this->css_search_frames(); + break; + + case 'csssearchlinks': + $this->print_css_searchlinks(); + break; + + case 'previewstate': + $this->do_message("Preview Window"); + break; + + //------------------------- + + case 'css_preview': + $this->css_preview(); + break; + + default: + exit(); + break; + } + + } + + //+--------------------------------------- + + function css_search_frames() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_GET_VARS; + + print " + Search + + + + + "; + + exit(); + } + + //+--------------------------------------- + + function css_preview() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_GET_VARS; + + //+--------------------------------------- + // GET THE TEMPLATES THAT THIS CSS USES + //+--------------------------------------- + + $DB->query("SELECT css_text, css_name FROM ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $set = $DB->fetch_row() ) + { + $ADMIN->error("Cannot query the database using that information"); + } + + $DB->query("SELECT img_dir FROM ibf_skins WHERE css_id='".$IN['id']."'"); + + $skin = $DB->fetch_row(); + + $element = trim(stripslashes($HTTP_GET_VARS['element'])); + + + list($type, $name) = explode( "|", $element ); + + $like = "class='{$name}'"; + $first = '.'; + + if ($type == 'id') + { + $like = "id='{$name}'"; + $first = '#'; + } + + preg_match( "/($first"."$name)\s{0,}\{(.+?)\}/s", $set['css_text'], $match ); + + //$definition = nl2br( str_replace( "\n\n", "\n", str_replace( "\r\n", "\n", $match[2]) ) ); + + //preg_match_all( "/(\S+?):(.+?);?/s", trim($match[2]), $defs ); + + $defs = explode( ";", str_replace( "\n\n", "\n", str_replace( "\r\n", "\n", trim($match[2]) ) ) ); + + $def_output = ""; + + foreach($defs as $bit) + { + list($type, $value) = explode( ":", trim($bit) ); + + $type = trim($type); + + $value = trim($value); + + if ($type != "" and $value != "") + { + $extra = ""; + + if ($type == 'color' or $type == 'background-color') + { + $extra = "   "; + } + + $def_output .= "$type$value $extra\n"; + } + } + + $css = "\n"; + + $html = " + + CSS Preview + $css + + + + + + +
    Preview CSS Element '$name'
    From style sheet '{$set['css_name']}'
    +
    + + + + + + + +
    Preview
    Cozy Lummux Gives Smart Squid Who Asks For Job Pen ([Indeed!])
    +
    + + + + + $def_output +
    Formatted CSS Definition
    + + + "; + + print $html; + + exit(); + + } + + //+--------------------------------------- + //+--------------------------------------- + + function print_css_searchlinks() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_GET_VARS; + + //+--------------------------------------- + // GET THE TEMPLATES THAT THIS CSS USES + //+--------------------------------------- + + $DB->query("SELECT tmpl_id FROM ibf_skins WHERE css_id='".$IN['id']."'"); + + if ( ! $set = $DB->fetch_row() ) + { + $ADMIN->error("Cannot query the database using that information"); + } + + $element = trim(stripslashes($HTTP_GET_VARS['element'])); + + + list($type, $name) = explode( "|", $element ); + + $like = "class=_{$name}"; + + if ($type == 'id') + { + $like = "id=_{$name}"; + } + + require './sources/Admin/skin_info.php'; + + //die("SELECT suid, set_id, group_name, func_name FROM ibf_skin_templates WHERE set_id='".$set['tmpl_id']."' AND section_content LIKE '%".$like."%' ORDER BY group_name"); + + $DB->query("SELECT suid, set_id, group_name, func_name FROM ibf_skin_templates WHERE set_id='".$set['tmpl_id']."' AND section_content LIKE '%".$like."%' ORDER BY group_name"); + + if (! $DB->get_num_rows() ) + { + $this->do_message("No matches for that string"); + } + + $results = array(); + + while ( $r = $DB->fetch_row() ) + { + if ( ! isset($result[ $r['group_name'] ]) ) + { + $result[ $r['group_name'] ] = array(); + } + + $result[ $r['group_name'] ][] = array( 'suid' => $r['suid'], 'func_name' => $r['func_name'] ); + + } + + $ADMIN->html .= $SKIN->start_table(); + + $ADMIN->html .= $SKIN->add_td_row( array( "Search Results" ) , 'title' ); + + foreach( $result as $group_name => $sub_array ) + { + if ( isset($skin_names[ $group_name ]) ) + { + $group_name = $skin_names[ $group_name ][0]; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "$group_name" ) , 'catrow' ); + + if (is_array($sub_array) and count($sub_array) > 0 ) + { + foreach( $sub_array as $idx => $data ) + { + $ADMIN->html .= $SKIN->add_td_row( array( "+ {$data['func_name']}" ) ); + } + } + } + + + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->print_popup(); + + } + + //+--------------------------------------- + //+--------------------------------------- + + function print_searchlinks() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['bypass'] == 1) + { + $this->do_message("No Search Results"); + } + + $search_text = trim($this->unconvert_tags(stripslashes($HTTP_POST_VARS['search']))); + + $search_text = str_replace( "\$", "\\$", $search_text); + $search_text = str_replace( "'" , "\\'", $search_text); + + if ($search_text == "") + { + $this->do_message("Please enter a string to search"); + } + + require './sources/Admin/skin_info.php'; + + $DB->query("SELECT set_id FROM ibf_skin_templates WHERE suid='".$IN['suid']."'"); + + $set = $DB->fetch_row(); + + $DB->query("SELECT suid, set_id, group_name, func_name FROM ibf_skin_templates WHERE set_id='".$set['set_id']."' AND section_content LIKE '%$search_text%' ORDER BY group_name"); + + if (! $DB->get_num_rows() ) + { + $this->do_message("No matches for that string"); + } + + $results = array(); + + while ( $r = $DB->fetch_row() ) + { + if ( ! isset($result[ $r['group_name'] ]) ) + { + $result[ $r['group_name'] ] = array(); + } + + $result[ $r['group_name'] ][] = array( 'suid' => $r['suid'], 'func_name' => $r['func_name'] ); + + } + + $ADMIN->html .= $SKIN->start_table(); + + $ADMIN->html .= $SKIN->add_td_row( array( "Search Results" ) , 'title' ); + + foreach( $result as $group_name => $sub_array ) + { + if ( isset($skin_names[ $group_name ]) ) + { + $group_name = $skin_names[ $group_name ][0]; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "$group_name" ) , 'catrow' ); + + if (is_array($sub_array) and count($sub_array) > 0 ) + { + foreach( $sub_array as $idx => $data ) + { + $ADMIN->html .= $SKIN->add_td_row( array( "+ {$data['func_name']}" ) ); + } + } + } + + + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->print_popup(); + + } + + //+--------------------------------------- + + function do_message($message="") + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->html = "

    $message

     "; + + $ADMIN->print_popup(); + + } + + //+--------------------------------------- + + function print_search_box() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'searchlinks' ), + 2 => array( 'act' , 'rtempl' ), + 3 => array( 'suid' , $IN['suid'] ) + ) ,'theform', 'target="links"' ); + + //+------------------------------- + + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Enter text to search for
    ". + $SKIN->form_input( 'search' ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Search!"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->print_popup(); + + } + + //+--------------------------------------- + + function search_frames() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + print " + Search + + + + + + + + "; + + exit(); + } + + //+--------------------------------------- + + function compare_frames() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + print " + + Compare + + + + + + + + + + + + "; + + exit(); + } + + //+--------------------------------------- + + function print_compare_top() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $content = $IN['content'] == 'orig' ? 'Original Template' : 'Current Template'; + + print " + +
    $content
    + "; + + exit(); + } + + //+--------------------------------------- + + function print_compare_new() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $DB->query("SELECT * FROM ibf_skin_templates WHERE suid='".$IN['suid']."'"); + + if ( ! $template = $DB->fetch_row() ) + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + $DB->query("SELECT css_id, img_dir FROM ibf_skins WHERE set_id='".$template['set_id']."'"); + $r = $DB->fetch_row(); + + $DB->query("SELECT css_text FROM ibf_css WHERE cssid='".$r['css_id']."'"); + + $css = $DB->fetch_row(); + + $css_text = "\n"; + + print " + $css_text + + + + + + "; + + exit(); + + + } + + //+--------------------------------------- + + function macro_one() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'macro_two' ), + 2 => array( 'act' , 'rtempl' ), + 3 => array( 'suid' , $IN['suid'] ) + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "60%" ); + $SKIN->td_header[] = array( " " , "40%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Macro Look-up" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Enter the Macro to look up
    (EG: {ibf.skin.tbl_width})", + $SKIN->form_input( 'lookup' ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Look-up"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->print_popup(); + + } + + //+------------------------------- + + function macro_two() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['lookup'] == "") + { + $ADMIN->error("You must enter a macro to look up", 1); + } + + $is_valid = 0; + $macro = ""; + $extra = ""; + + if ( preg_match( "/<\{(\S+)\}>/", $IN['lookup'], $match ) ) + { + $is_valid = 1; + $macro = $match[1]; + } + + else if ( preg_match( "/{ibf\.(skin|lang|vars|member)\.(\w+)}$/", $IN['lookup'], $match ) ) + { + $is_valid = 1; + $macro = $match[2]; + $extra = $match[1]; + } + else + { + $is_valid = 0; + } + + if ($is_valid != 1) + { + $ADMIN->error("The entered macro was in the wrong format, please try again", 1); + } + + if ($extra != "") + { + if ($extra == 'member') + { + if (isset($MEMBER[$macro])) + { + if ($MEMBER[$macro] == "") + { + $answer = ""; + } + else + { + $answer = $MEMBER[$macro]; + } + } + else if (isset($GROUP[$macro])) + { + if ($GROUP[$macro] == "") + { + $answer = ""; + } + else + { + $answer = $GROUP[$macro]." (This is member group information)"; + } + } + + $result = "Loaded Member Information"; + } + else if ($extra == 'vars') + { + + // Filter out sensitive stuff + + $safe_INFO['board_name'] = $INFO['board_name']; + $safe_INFO['board_url'] = $INFO['board_url']; + + $answer = $safe_INFO[$macro]; + + $result = "Config Variable Information (May be protected)"; + } + else if ($extra == 'lang') + { + $result = "Language Text"; + + $DB->query("SELECT group_name FROM ibf_skin_templates WHERE suid='{$IN['suid']}'"); + + if ( $r = $DB->fetch_row() ) + { + $filename = preg_replace( "/^skin_/", "lang_", $r['group_name'] ); + + if ( @file_exists( "./lang/en/$filename".".php" ) ) + { + require "./lang/en/$filename".".php"; + + $answer = $lang[$macro]; + } + } + } + } + else + { + // Is macro + + $DB->query("SELECT set_id FROM ibf_skin_templates WHERE suid='{$IN['suid']}'"); + + $template = $DB->fetch_row(); + + $DB->query("SELECT macro_id FROM ibf_skins WHERE set_id='".$template['set_id']."'"); + + $macrod = $DB->fetch_row(); + + $DB->query("SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set='".$macrod['macro_id']."' AND macro_value='$macro'"); + + if ($val = $DB->fetch_row()) + { + $answer = $val['macro_replace']; + $result = "From Macro Set"; + } + else + { + $answer = "Macro not found"; + } + } + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Macro Look-up Result Go Again" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Entered Macro", $IN['lookup'] ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Macro Type", $result ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Result
    May be blank if no info", $answer ) ); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->print_popup(); + + + + } + + //+------------------------------- + //+------------------------------- + + function do_preview() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_GET_VARS; + + + if ($IN['suid'] == "") + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + $DB->query("SELECT * FROM ibf_skin_templates WHERE suid='".$IN['suid']."'"); + + if ( ! $template = $DB->fetch_row() ) + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + $table = " + + + + + + +
    Template Group: {$template['group_name']} : Template bit: {$template['func_name']}
    View as [ Text | HTML | HTML with CSS ]
    +

    + "; + + if ($IN['type'] == 'text') + { + @header("Content-type: text/html"); + print $table; + $html = $this->convert_tags($template['section_content']); + + $html = str_replace( "<" , "<" , $html); + $html = str_replace( ">" , ">" , $html); + $html = str_replace( "\"", """, $html); + + if ($HTTP_GET_VARS['hl'] != "") + { + $hl = urldecode(stripslashes($HTTP_GET_VARS['hl'])); + + $hl = str_replace( "<" , "<" , $hl); + $hl = str_replace( ">" , ">" , $hl); + $hl = str_replace( "\"", """, $hl); + + $html = str_replace( $hl, "$hl", $html ); + } + + $html = preg_replace( "!<\!--(.+?)(//)?-->!s" , "<!--\\1--\\2>", $html ); + $html = preg_replace( "#<([^&<>]+)>#s" , "<\\1>" , $html ); //Matches + $html = preg_replace( "#<([^&<>]+)=#s" , "<\\1=" , $html ); //Matches \\1>" , $html ); //Matches + $html = preg_replace( "!=("|')([^<>])("|')(\s|>)!s" , "=\\1\\2\\3\\4" , $html ); //Matches ='this' + + $html = str_replace( "\n", "
    ", str_replace("\r\n", "\n", $html ) ); + + print "
    ".$html."
    "; + exit(); + + } + else if ($IN['type'] == 'html') + { + @header("Content-type: text/html"); + print $table; + print $this->convert_tags($template['section_content']); + + exit(); + } + else if($IN['type'] == 'css') + { + $DB->query("SELECT css_id, img_dir FROM ibf_skins WHERE set_id='".$template['set_id']."'"); + $r = $DB->fetch_row(); + + $DB->query("SELECT css_text FROM ibf_css WHERE cssid='".$r['css_id']."'"); + + $css = $DB->fetch_row(); + + $css_text = "\n"; + + @header("Content-type: text/html"); + print "Preview$css_text$table \n"; + print $this->convert_tags($template['section_content']); + + exit(); + + } + + + + } + + + //------------------------------------------------------ + + + + function convert_tags($t="") + { + if ($t == "") + { + return ""; + } + + $t = preg_replace( "/{?\\\$ibforums->base_url}?/" , "{ibf.script_url}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->session_id}?/" , "{ibf.session_id}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->skin\['?(\w+)'?\]}?/" , "{ibf.skin.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->lang\['?(\w+)'?\]}?/" , "{ibf.lang.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->vars\['?(\w+)'?\]}?/" , "{ibf.vars.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->member\['?(\w+)'?\]}?/" , "{ibf.member.\\1}" , $t ); + + return $t; + + } + + function unconvert_tags($t="") + { + if ($t == "") + { + return ""; + } + + $t = preg_replace( "/{ibf\.script_url}/i" , '{$ibforums->base_url}' , $t); + $t = preg_replace( "/{ibf\.session_id}/i" , '{$ibforums->session_id}' , $t); + $t = preg_replace( "/{ibf\.skin\.(\w+)}/" , '{$ibforums->skin[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.lang\.(\w+)}/" , '{$ibforums->lang[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.vars\.(\w+)}/" , '{$ibforums->vars[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.member\.(\w+)}/" , '{$ibforums->member[\''."\\1".'\']}' , $t); + + return $t; + + } + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_settings.php b/upload/sources/Admin/ad_settings.php index fb6363f7..9f60441f 100644 --- a/upload/sources/Admin/ad_settings.php +++ b/upload/sources/Admin/ad_settings.php @@ -1,1440 +1,1679 @@ - Admin Setting functions -| > Module written by Matt Mecham -| > Date started: 20th March 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'cookie': - $this->cookie(); - break; - case 'docookie': - $this->save_config( array( 'cookie_domain', 'cookie_id', 'cookie_path' ) ); - break; - //------------------------- - case 'secure': - $this->secure(); - break; - case 'dosecure': - $this->save_config( array ( 'allow_dynamic_img','session_expiration','match_browser','allow_dup_email','allow_images', 'force_login', 'no_reg', - 'allow_flash','new_reg_notify','use_mail_form','flood_control', 'allow_online_list', 'reg_auth_type' ) ); - break; - //------------------------- - case 'post': - $this->post(); - break; - case 'dopost': - $this->save_config( array ( 'guest_name_pre', 'guest_name_suf', 'max_w_flash', 'max_h_flash', 'hot_topic', 'display_max_topics','display_max_posts','max_emos','max_images','emo_per_row', 'etfilter_punct', 'etfilter_shout', - 'max_post_length','show_img_upload','pre_polls','pre_moved','pre_pinned','img_ext' ) ); - break; - //------------------------- - case 'avatars': - $this->avatars(); - break; - case 'doavatars': - $this->save_config( array ( 'allow_skins', 'max_sig_length', 'sig_allow_ibc', 'sig_allow_html','avatar_ext','avatar_url','avup_size_max','avatars_on','avatar_dims','avatar_def', 'max_location_length', 'max_interest_length', 'post_titlechange', 'guests_ava', 'guests_img', 'guests_sig' ) ); - break; - //------------------------- - case 'dates': - $this->dates(); - break; - case 'dodates': - $this->save_config( array ( 'time_offset','clock_short','clock_joined','clock_long', 'time_adjust' ) ); - break; - //------------------------- - case 'cpu': - $this->cpu(); - break; - case 'docpu': - $this->save_config( array ( 'load_limit','show_active','show_birthdays','show_totals','allow_search', 'show_user_posted', 'nocache' ) ); - break; - //------------------------- - case 'url': - $this->url(); - break; - case 'dourl': - $this->save_config( array ( 'email_in','email_out','board_name','board_url','home_name','home_url', 'disable_gzip', - 'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level' ) ); - break; - //------------------------- - case 'pm': - $this->pm(); - break; - case 'dopm': - $this->save_config( array ( 'max_messages', 'msg_allow_code', 'msg_allow_html' ) ); - break; - //------------------------- - case 'news': - $this->news(); - break; - case 'donews': - $this->save_config( array ( 'news_forum_id', 'index_news_link' ) ); - break; - //------------------------- - case 'board': - $this->board(); - break; - case 'doboard': - $this->save_config( array ( 'board_offline', 'offline_msg' ) ); - break; - //------------------------- - case 'bw': - $this->badword(); - break; - case 'bw_add': - $this->add_badword(); - break; - case 'bw_remove': - $this->remove_badword(); - break; - case 'bw_edit': - $this->edit_badword(); - break; - case 'bw_doedit': - $this->doedit_badword(); - break; - //------------------------- - case 'emo': - $this->emoticons(); - break; - case 'emo_add': - $this->add_emoticons(); - break; - case 'emo_remove': - $this->remove_emoticons(); - break; - case 'emo_edit': - $this->edit_emoticons(); - break; - case 'emo_doedit': - $this->doedit_emoticons(); - break; - //------------------------- - case 'count': - $this->countstats(); - break; - case 'docount': - $this->docount(); - break; - default: - $this->cookie(); - break; - } - - } - - //===================================================== - - function docount() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ( (! $IN['posts']) and (! $IN['members'] ) and (! $IN['lastreg'] ) ) - { - $ADMIN->error("Nothing to recount!"); - } - - $stats = array(); - - if ($IN['posts']) - { - $DB->query("SELECT COUNT(pid) as posts FROM ibf_posts WHERE queued <> 1"); - $r = $DB->fetch_row(); - $stats['TOTAL_REPLIES'] = $r['posts']; - $stats['TOTAL_REPLIES'] < 1 ? 0 : $stats['TOTAL_REPLIES']; - - $DB->query("SELECT COUNT(tid) as topics FROM ibf_topics WHERE approved = 1"); - $r = $DB->fetch_row(); - $stats['TOTAL_TOPICS'] = $r['topics']; - $stats['TOTAL_TOPICS'] < 1 ? 0 : $stats['TOTAL_TOPICS']; - - $stats['TOTAL_REPLIES'] -= $stats['TOTAL_TOPICS']; - } - - if ($IN['members']) - { - $DB->query("SELECT COUNT(id) as members from ibf_members WHERE mgroup <> '".$INFO['auth_group']."'"); - $r = $DB->fetch_row(); - $stats['MEM_COUNT'] = $r['members']; - // Remove "guest" account... - $stats['MEM_COUNT']--; - $stats['MEM_COUNT'] < 1 ? 0 : $stats['MEM_COUNT']; - } - - if ($IN['lastreg']) - { - $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY id DESC LIMIT 0,1"); - $r = $DB->fetch_row(); - $stats['LAST_MEM_NAME'] = $r['name']; - $stats['LAST_MEM_ID'] = $r['id']; - } - - if ($IN['online']) - { - $stats['MOST_DATE'] = time(); - $stats['MOST_COUNT'] = 1; - } - - if ( count($stats) > 0 ) - { - $db_string = $DB->compile_db_update_string( $stats ); - $DB->query("UPDATE ibf_stats SET $db_string"); - } - else - { - $ADMIN->error("Nothing to recount!"); - } - - $ADMIN->done_screen("Statistics Recounted", "Administration CP Home", "act=index" ); - - } - - - - function countstats() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "Please choose which statistics to recount."; - $ADMIN->page_title = "Recount Statistics Control"; - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'docount' ), - 2 => array( 'act' , 'op' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( "Statistic" , "70%" ); - $SKIN->td_header[] = array( "Option" , "30%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Recount Statistics" ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Recount total topics and posts", - $SKIN->form_dropdown( 'posts', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Recount Members", - $SKIN->form_dropdown( 'members', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Reset last registered member", - $SKIN->form_dropdown( 'lastreg', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Reset 'Most online' statistic?", - $SKIN->form_dropdown( 'online', array( 0 => array( 0, 'No' ), 1 => array( 1, 'Yes' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->end_form('Reset these statistics'); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //------------------------------------------------------------- - // URLs and ADDRESSES - //-------------------------------------------------------------- - - function board() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('doboard', 'Board offline/online', 'You may change the configuration below'); - - $ADMIN->html .= $SKIN->add_td_row( array( "Turn the board offline?
    The board will still be accessable by those who have permission" , - $SKIN->form_yes_no( "board_offline", $INFO['board_offline'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "The offline message to display" , - $SKIN->form_textarea( "offline_msg", $INFO['offline_msg'] ) - ) ); - - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // EMOTICON FUNCTIONS - //------------------------------------------------------------- - - function doedit_emoticons() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['before'] == "") - { - $ADMIN->error("You must enter text to replace, silly!"); - } - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid emoticon id, silly!"); - } - - $IN['clickable'] = $IN['clickable'] ? 1 : 0; - - $db_string = $DB->compile_db_update_string( array( 'typed' => $IN['before'], - 'image' => $IN['after'], - 'clickable' => $IN['click'], - ) ); - - $DB->query("UPDATE ibf_emoticons SET $db_string WHERE id='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=op&code=emo"); - exit(); - - - } - - //===================================================== - - - function edit_emoticons() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You may edit the emoticon filter below"; - $ADMIN->page_title = "Edit Emoticon"; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid filter id, silly!"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_emoticons WHERE id='".$IN['id']."'"); - - if ( ! $r = $DB->fetch_row() ) - { - $ADMIN->error("We could not find that emoticon in the database"); - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'emo_doedit' ), - 2 => array( 'act' , 'op' ), - 3 => array( 'id' , $IN['id'] ), - ) ); - - - - $SKIN->td_header[] = array( "Before" , "40%" ); - $SKIN->td_header[] = array( "After" , "40%" ); - $SKIN->td_header[] = array( "+ Clickable" , "20%" ); - - //+------------------------------- - - $emos = array(); - - if (! is_dir($INFO['html_dir'].'emoticons') ) - { - $ADMIN->error("Could not locate the emoticons directory - make sure the 'html_dir' path is set correctly"); - } - - //+------------------------------- - - - $dh = opendir( $INFO['html_dir'].'emoticons' ) or die("Could not open the emoticons directory for reading, check paths and permissions"); - while ( $file = readdir( $dh ) ) - { - if ( !preg_match( "/^..?$|^index|htm$|html$|^\./i", $file ) ) - { - $emos[] = array( $file, $file ); - } - } - closedir( $dh ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Edit an Emoticon" ); - - $ADMIN->html .= " - "; - - $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before', stripslashes($r['typed']) ), - $SKIN->form_dropdown('after', $emos, $r['image'], "onChange='show_emo()'") . "  ", - $SKIN->form_dropdown( 'click', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ), $r['clickable'] ) - ) ); - - $ADMIN->html .= $SKIN->end_form('Edit Emoticon'); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //===================================================== - - function remove_emoticons() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid emoticon id, silly!"); - } - - $DB->query("DELETE FROM ibf_emoticons WHERE id='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=op&code=emo"); - exit(); - - - } - - //===================================================== - - function add_emoticons() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['before'] == "") - { - $ADMIN->error("You must enter an emoticon text to replace, silly!"); - } - - $IN['click'] = $IN['click'] ? 1 : 0; - - $db_string = $DB->compile_db_insert_string( array( 'typed' => $IN['before'], - 'image' => $IN['after'], - 'clickable' => $IN['click'], - ) ); - - $DB->query("INSERT INTO ibf_emoticons (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $std->boink_it($SKIN->base_url."&act=op&code=emo"); - exit(); - - - } - - - function perly_length_sort($a, $b) - { - if ( strlen($a['typed']) == strlen($b['typed']) ) - { - return 0; - } - return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1; - } - - function perly_word_sort($a, $b) - { - if ( strlen($a['type']) == strlen($b['type']) ) - { - return 0; - } - return ( strlen($a['type']) > strlen($b['type']) ) ? -1 : 1; - } - - //===================================================== - - function emoticons() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You may add/edit or remove emoticons in this section.
    You can only choose emoticons that have been uploaded into the 'html/emoticons' directory.

    Clickable refers to emoticons that are in the posting screens 'Clickable Emoticons' table."; - $ADMIN->page_title = "Emoticon Control"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Before" , "30%" ); - $SKIN->td_header[] = array( "After" , "30%" ); - $SKIN->td_header[] = array( "+ Clickable" , "20%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - //+------------------------------- - - - - $ADMIN->html .= $SKIN->start_table( "Current Emoticons" ); - - $DB->query("SELECT * from ibf_emoticons"); - - $emo_url = $INFO['html_url'] . '/emoticons'; - - $smilies = array(); - - if ( $DB->get_num_rows() ) - { - while ( $r = $DB->fetch_row() ) - { - $smilies[] = $r; - } - - usort($smilies, array( 'ad_settings', 'perly_length_sort' ) ); - - foreach( $smilies as $array_idx => $r ) - { - - $click = $r['clickable'] ? 'Yes' : 'No'; - - $ADMIN->html .= $SKIN->add_td_row( array( stripslashes($r['typed']), - "
    ", - "
    $click
    ", - "
    Edit
    ", - "
    Remove
    ", - ) ); - - - - } - } - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - - $emos = array(); - - if (! is_dir($INFO['html_dir'].'emoticons') ) - { - $ADMIN->error("Could not locate the emoticons directory - make sure the 'html_dir' path is set correctly"); - } - - //+------------------------------- - - $cnt = 0; - $start = ""; - - $dh = opendir( $INFO['html_dir'].'emoticons' ) or die("Could not open the emoticons directory for reading, check paths and permissions"); - while ( $file = readdir( $dh ) ) - { - if ( !preg_match( "/^..?$|^index|htm$|html$|^\./i", $file ) ) - { - $emos[] = array( $file, $file ); - - if ($cnt == 0) - { - $cnt = 1; - $start = $file; - } - } - } - closedir( $dh ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'emo_add' ), - 2 => array( 'act' , 'op' ), - ) ); - - - $SKIN->td_header[] = array( "Before" , "40%" ); - $SKIN->td_header[] = array( "After" , "40%" ); - $SKIN->td_header[] = array( "+ Clickable" , "20%" ); - - //+------------------------------- - - $ADMIN->html .= " - "; - - $ADMIN->html .= $SKIN->start_table( "Add a new Emoticon" ); - - $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before'), - $SKIN->form_dropdown('after', $emos, "", "onChange='show_emo()'") . "  ", - $SKIN->form_dropdown( 'click', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->end_form('Add Emoticon'); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //------------------------------------------------------------- - // BADWORD FUNCTIONS - //-------------------------------------------------------------- - - - function doedit_badword() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['before'] == "") - { - $ADMIN->error("You must enter a word to replace, silly!"); - } - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid filter id, silly!"); - } - - $IN['match'] = $IN['match'] ? 1 : 0; - - strlen($IN['swop']) > 1 ? $IN['swop'] : ""; - - $db_string = $DB->compile_db_update_string( array( 'type' => $IN['before'], - 'swop' => $IN['after'], - 'm_exact' => $IN['match'], - ) ); - - $DB->query("UPDATE ibf_badwords SET $db_string WHERE wid='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=op&code=bw"); - exit(); - - - } - - //===================================================== - - function edit_badword() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You may edit the chosen filter below"; - $ADMIN->page_title = "Bad Word Filter"; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid filter id, silly!"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_badwords WHERE wid='".$IN['id']."'"); - - if ( ! $r = $DB->fetch_row() ) - { - $ADMIN->error("We could not find that filter in the database"); - } - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'bw_doedit' ), - 2 => array( 'act' , 'op' ), - 3 => array( 'id' , $IN['id'] ), - ) ); - - - - $SKIN->td_header[] = array( "Before" , "40%" ); - $SKIN->td_header[] = array( "After" , "40%" ); - $SKIN->td_header[] = array( "Method" , "20%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Edit a filter" ); - - $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before', stripslashes($r['type']) ), - $SKIN->form_input('after' , stripslashes($r['swop']) ), - $SKIN->form_dropdown( 'match', array( 0 => array( 1, 'Exact' ), 1 => array( 0, 'Loose' ) ), $r['m_exact'] ) - ) ); - - $ADMIN->html .= $SKIN->end_form('Edit Filter'); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //===================================================== - - function remove_badword() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must pass a valid filter id, silly!"); - } - - $DB->query("DELETE FROM ibf_badwords WHERE wid='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=op&code=bw"); - exit(); - - - } - - //===================================================== - - function add_badword() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['before'] == "") - { - $ADMIN->error("You must enter a word to replace, silly!"); - } - - $IN['match'] = $IN['match'] ? 1 : 0; - - strlen($IN['swop']) > 1 ? $IN['swop'] : ""; - - $db_string = $DB->compile_db_insert_string( array( 'type' => $IN['before'], - 'swop' => $IN['after'], - 'm_exact' => $IN['match'], - ) ); - - $DB->query("INSERT INTO ibf_badwords (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $std->boink_it($SKIN->base_url."&act=op&code=bw"); - exit(); - - - } - - //===================================================== - - function badword() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->page_detail = "You can add/edit and remove bad word filters in this section.
    The badword filter allows you to globally replace words from a members post, signature and topic title.

    Loose matching: If you entered 'hell' as a bad word, it will replace 'hell' and 'hello' with either your replacement if entered or 6 hashes (case insensitive)

    Exact matching: If you entered 'hell' as a bad word, it will replace 'hell' only with either your replacement if entered or 6 hashes (case insensitive)"; - $ADMIN->page_title = "Bad Word Filter"; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'bw_add' ), - 2 => array( 'act' , 'op' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( "Before" , "30%" ); - $SKIN->td_header[] = array( "After" , "30%" ); - $SKIN->td_header[] = array( "Method" , "20%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Current Filters" ); - - $DB->query("SELECT * from ibf_badwords"); - - if ( $DB->get_num_rows() ) - { - while ( $r = $DB->fetch_row() ) - { - $words[] = $r; - } - - usort($words, array( 'ad_settings', 'perly_word_sort' ) ); - - foreach($words as $idx => $r) - { - - $replace = $r['swop'] ? stripslashes($r['swop']) : '######'; - - $method = $r['m_exact'] ? 'Exact' : 'Loose'; - - $ADMIN->html .= $SKIN->add_td_row( array( stripslashes($r['type']), - $replace, - $method, - "
    Edit
    ", - "
    Remove
    ", - ) ); - } - - } - - $ADMIN->html .= $SKIN->end_table(); - - - $SKIN->td_header[] = array( "Before" , "40%" ); - $SKIN->td_header[] = array( "After" , "40%" ); - $SKIN->td_header[] = array( "Method" , "20%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Add a new filter" ); - - $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before'), - $SKIN->form_input('after'), - $SKIN->form_dropdown( 'match', array( 0 => array( 1, 'Exact' ), 1 => array( 0, 'Loose' ) ) ) - ) ); - - $ADMIN->html .= $SKIN->end_form('Add Filter'); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } - - //------------------------------------------------------------- - // NEWS - //-------------------------------------------------------------- - - function news() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('donews', 'News Export Set-Up', 'You may change the configuration below'); - - $DB->query("SELECT id, name FROM ibf_forums WHERE subwrap = 0"); - - $form_array = array(); - - while ( $r = $DB->fetch_row() ) - { - $form_array[] = array( $r['id'], $r['name'] ); - } - - $ADMIN->html .= $SKIN->add_td_row( array( "Export news topics from which forum?" , - $SKIN->form_dropdown( "news_forum_id", $form_array, $INFO['news_forum_id'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Show a 'Latest News' link on the board index?" , - $SKIN->form_yes_no( "index_news_link", $INFO['index_news_link'] ) - ) ); - - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // PM - //-------------------------------------------------------------- - - function pm() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('dopm', 'Messenger Set up', 'You may change the configuration below'); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. No. of storable messages?
    Leave blank to not impose a limit" , - $SKIN->form_input( "max_messages", $INFO['max_messages'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow IBF Code in messages?" , - $SKIN->form_yes_no( "msg_allow_code", $INFO['msg_allow_code'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow HTML in messages?" , - $SKIN->form_yes_no( "msg_allow_html", $INFO['msg_allow_html'] ) - ) ); - - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // URLs and ADDRESSES - //-------------------------------------------------------------- - - function url() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('dourl', 'URL\'s, Paths and Addresses', 'You may change the configuration below'); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Board incoming email address" , - $SKIN->form_input( "email_in", $INFO['email_in'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Board outgoing email address" , - $SKIN->form_input( "email_out", $INFO['email_out'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Board Name" , - $SKIN->form_input( "board_name", $INFO['board_name'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Board Address" , - $SKIN->form_input( "board_url", $INFO['board_url'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Website Name" , - $SKIN->form_input( "home_name", $INFO['home_name'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Website Address" , - $SKIN->form_input( "home_url", $INFO['home_url'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "HTML URL
    For images, etc" , - $SKIN->form_input( "html_url", $INFO['html_url'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Upload URL" , - $SKIN->form_input( "upload_url", $INFO['upload_url'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Upload Directory" , - $SKIN->form_input( "upload_dir", $INFO['upload_dir'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Print HTTP headers?
    (Some NT installs require this off)" , - $SKIN->form_yes_no( "print_headers", $INFO['print_headers'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "DISABLE GZIP encoding?
    (GZIP enables faster page transfer and lower bandwidth use)" , - $SKIN->form_yes_no( "disable_gzip", $INFO['disable_gzip'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Type of auto-redirect?
    (This is for quick no page redirects)" , - $SKIN->form_dropdown( 'header_redirect', - array( - 0 => array( 'location', 'Location type (*nix savvy)' ), - 1 => array( 'refresh' , 'Refresh (Windows savvy)' ), - ), - $INFO['header_redirect'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Debug level" , - $SKIN->form_dropdown( "debug_level", - array( - 0 => array( 0, '0: None - Don\'t show any debug information' ), - 1 => array( 1, '1: Show server load, page generation times and query count' ), - 2 => array( 2, '2: Show level 1 (above) and GET and POST information'), - 3 => array( 3, '3: Show level 1 + 2 and database queries'), - ), - $INFO['debug_level'] ) - ) ); - - - $this->common_footer(); - - - } - - - - //------------------------------------------------------------- - // CPU SAVING - //-------------------------------------------------------------- - - function cpu() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('docpu', 'CPU Saving', 'You can opt to turn some features off to minimize the resource footprint'); - - - $ADMIN->html .= $SKIN->add_td_row( array( "Server Load Limit
    Will display 'busy' message when limit hit
    Can be left blank for no limit" , - $SKIN->form_input( "load_limit", $INFO['load_limit'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Show Active Users?" , - $SKIN->form_yes_no( "show_active", $INFO['show_active'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Show Birthdays?" , - $SKIN->form_yes_no( "show_birthdays", $INFO['show_birthdays'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Show Board Totals?" , - $SKIN->form_yes_no( "show_totals", $INFO['show_totals'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow users (where allowed) to use search?" , - $SKIN->form_yes_no( "allow_search", $INFO['allow_search'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Mark topics a user has posted when displaying a forum?" , - $SKIN->form_yes_no( "show_user_posted", $INFO['show_user_posted'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Print HTTP no-cache headers?
    (This will stop browsers caching pages)" , - $SKIN->form_yes_no( "nocache", $INFO['nocache'] ) - ) ); - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // DATES - //-------------------------------------------------------------- - - function dates() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('dodates', 'Dates', 'Define date formats'); - - $time_array = array(); - - require $root_path."lang/en/lang_ucp.php"; - - foreach( $lang as $off => $words ) - { - if (preg_match("/^time_(\S+)$/", $off, $match)) - { - $time_select[] = array( $match[1], $words ); - } - } - - $d_date = $std->get_date(time(), 'LONG'); - - $ADMIN->html .= $SKIN->add_td_row( array( "Native Server Time Zone
    If you have chosen the correct timezone and the clock is an hour out, this is because of daylight savings time and your members can correct this by editing their 'Board settings' via their User Control Panel." , - $SKIN->form_dropdown( "time_offset", $time_select, $INFO['time_offset'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Server Time Adjustment (in minutes)
    You fine tune the server time. If you need to subtract minutes from the server time, start the number with a '-' (no quotes)." , - $SKIN->form_input( "time_adjust", $INFO['time_adjust'] ) . "
    Board time (inc. above time zone and current adj.) is now: $d_date" - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Short time format
    Same configuration as PHP Date" , - $SKIN->form_input( "clock_short", $INFO['clock_short'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Join date time format
    Same configuration as PHP Date" , - $SKIN->form_input( "clock_joined", $INFO['clock_joined'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Long time format
    Same configuration as PHP Date" , - $SKIN->form_input( "clock_long", $INFO['clock_long'] ) - ) ); - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // AVATARS - //-------------------------------------------------------------- - - function avatars() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('doavatars', 'User Profiles', 'Define user profile permissions'); - - $INFO['avatar_ext'] = preg_replace( "/\|/", ",", $INFO['avatar_ext'] ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow members to choose skins?" , - $SKIN->form_yes_no( "allow_skins", $INFO['allow_skins'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow the use of avatars?" , - $SKIN->form_yes_no( "avatars_on", $INFO['avatars_on'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allowed image extensions
    Seperate with comma (gif,png,jpeg) etc" , - $SKIN->form_input( "avatar_ext", $INFO['avatar_ext'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow users to use remote URL avatars?" , - $SKIN->form_yes_no( "avatar_url", $INFO['avatar_url'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. file size for avatar uploads? (K)" , - $SKIN->form_input( "avup_size_max", $INFO['avup_size_max'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Maximum avatar dimensions
    (WIDTHxHEIGHT)" , - $SKIN->form_input( "avatar_dims", $INFO['avatar_dims'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Default sizes for gallery avatars
    (WIDTHxHEIGHT)" , - $SKIN->form_input( "avatar_def", $INFO['avatar_def'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "No. of posts a user must have before change of member title is allowed?" , - $SKIN->form_input( "post_titlechange", $INFO['post_titlechange'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for the location field entry" , - $SKIN->form_input( "max_location_length", $INFO['max_location_length'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for the interests field entry" , - $SKIN->form_input( "max_interest_length", $INFO['max_interest_length'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for user signatures" , - $SKIN->form_input( "max_sig_length", $INFO['max_sig_length'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow HTML in signatures?" , - $SKIN->form_yes_no( "sig_allow_html", $INFO['sig_allow_html'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow IBF Code in signatures?" , - $SKIN->form_yes_no( "sig_allow_ibc", $INFO['sig_allow_ibc'] ) - ) ); - - //-------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view signatures?" , - $SKIN->form_yes_no( "guests_sig", $INFO['guests_sig'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view posted images?" , - $SKIN->form_yes_no( "guests_img", $INFO['guests_img'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view user avatars?" , - $SKIN->form_yes_no( "guests_ava", $INFO['guests_ava'] ) - ) ); - - - $this->common_footer(); - - - } - - - //------------------------------------------------------------- - // TOPICS and POSTS - //-------------------------------------------------------------- - - function post() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $INFO['img_ext'] = preg_replace( "/\|/", ",", $INFO['img_ext'] ); - - $this->common_header('dopost', 'Topics, Posts and Posting', 'Configure the viewable post elements and limits.'); - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of topics per forum page" , - $SKIN->form_input( "display_max_topics", $INFO['display_max_topics'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of posts per topic page" , - $SKIN->form_input( "display_max_posts", $INFO['display_max_posts'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Number of posts needed to make a 'hot topic'?" , - $SKIN->form_input( "hot_topic", $INFO['hot_topic'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "No. emoticons per clickable table row" , - $SKIN->form_input( "emo_per_row", $INFO['emo_per_row'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. no. emoticons per post" , - $SKIN->form_input( "max_emos", $INFO['max_emos'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. no. images per post" , - $SKIN->form_input( "max_images", $INFO['max_images'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. size of post (in kilobytes [k])" , - $SKIN->form_input( "max_post_length", $INFO['max_post_length'] ) - ) ); - - // - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. width of posted Flash movies (in pixels)" , - $SKIN->form_input( "max_w_flash", $INFO['max_w_flash'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Max. height of posted Flash movies (in pixels)" , - $SKIN->form_input( "max_h_flash", $INFO['max_h_flash'] ) - ) ); - - // - - $ADMIN->html .= $SKIN->add_td_row( array( "Valid postable image extensions
    (Seperate with comma (gif,jpeg,jpg) etc" , - $SKIN->form_input( "img_ext", $INFO['img_ext'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Show uploaded images in post?" , - $SKIN->form_yes_no( "show_img_upload", $INFO['show_img_upload'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for PINNED topics" , - $SKIN->form_input( "pre_pinned", $INFO['pre_pinned'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for MOVED topics" , - $SKIN->form_input( "pre_moved", $INFO['pre_moved'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for POLLS" , - $SKIN->form_input( "pre_polls", $INFO['pre_polls'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Stop shouting in topic titles?
    (Will turn: CLICK HERE into Click Here)" , - $SKIN->form_yes_no( "etfilter_shout", $INFO['etfilter_shout'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Remove excess exclamation/question marks in topic titles?
    (Will turn: This!!!!! into This!)" , - $SKIN->form_yes_no( "etfilter_punct", $INFO['etfilter_punct'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Guest names prefix
    (This is for when a guest posts with a members name, it allows for a visual difference to prevent confusion)" , - $SKIN->form_input( "guest_name_pre", $INFO['guest_name_pre'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Guest names suffix
    (This is for when a guest posts with a members name, it allows for a visual difference to prevent confusion)" , - $SKIN->form_input( "guest_name_suf", $INFO['guest_name_suf'] ) - ) ); - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // SECURITY - //-------------------------------------------------------------- - - function secure() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('dosecure', 'Security', 'Define the level of security your board possess by using the configurations below'); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow dynamic images?
    If 'yes' users can post scripted image generators" , - $SKIN->form_yes_no( "allow_dynamic_img", $INFO['allow_dynamic_img'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Session Expiration (in seconds)
    Removes inactive sessions over the limit you specify" , - $SKIN->form_input( "session_expiration", $INFO['session_expiration'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Match users browsers while validating?" , - $SKIN->form_yes_no( "match_browser", $INFO['match_browser'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow duplicate emails when user registers?
    Will not check for existing email address" , - $SKIN->form_yes_no( "allow_dup_email", $INFO['allow_dup_email'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow images to be posted?
    Advanced programmers can force images to run as scripts. IBF limits damage by this method however." , - $SKIN->form_yes_no( "allow_images", $INFO['allow_images'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow flash movies in posts and avatars?
    Flash has a built in scripting language" , - $SKIN->form_yes_no( "allow_flash", $INFO['allow_flash'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "New registration email validation?
    Make admin manually preview all new accounts or make new users validate their email address" , - $SKIN->form_dropdown( "reg_auth_type", - array( - 0 => array( 'user' , 'User Email Validation' ), - 1 => array( 'admin', 'Admin Validation' ), - 2 => array( '0' , 'None' ) - ), - $INFO['reg_auth_type'] - ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Get notified when a new user registers via email?" , - $SKIN->form_dropdown( "new_reg_notify", - array( - 0 => array( '1' , 'Yes' ), - 1 => array( '0' , 'No' ) - ), - $INFO['new_reg_notify'] - ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Use secure mail form for member to member mails?
    Hides users email addresses" , - $SKIN->form_yes_no( "use_mail_form", $INFO['use_mail_form'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Flood control delay (in seconds)
    Make users wait before posting again
    Can be left blank for no flood control" , - $SKIN->form_input( "flood_control", $INFO['flood_control'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Allow users to browse the Active Users list?" , - $SKIN->form_yes_no( "allow_online_list", $INFO['allow_online_list'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Force guests to log in before allowing access to the board?" , - $SKIN->form_yes_no( "force_login", $INFO['force_login'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Disable new registrations?" , - $SKIN->form_yes_no( "no_reg", $INFO['no_reg'] ) - ) ); - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // COOKIES: Yum Yum! - //-------------------------------------------------------------- - - function cookie() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $this->common_header('docookie', 'Cookies', 'All of these fields can be left blank. Experiment to find the correct settings for your host'); - - $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Domain
    Hint: use .your-domain.com for global cookies" , - $SKIN->form_input( "cookie_domain", $INFO['cookie_domain'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Name Prefix
    Allows multiple boards on one host." , - $SKIN->form_input( "cookie_id", $INFO['cookie_id'] ) - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Path
    Relative path from domain to root IBF dir" , - $SKIN->form_input( "cookie_path", $INFO['cookie_path'] ) - ) ); - - $this->common_footer(); - - - } - - //------------------------------------------------------------- - // - // Save config. Does the hard work, so you don't have to. - // - //-------------------------------------------------------------- - - function save_config( $new ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - $master = array(); - - if ( is_array($new) ) - { - if ( count($new) > 0 ) - { - foreach( $new as $field ) - { - - // Handle special.. - - if ($field == 'img_ext' or $field == 'avatar_ext') - { - $HTTP_POST_VARS[ $field ] = preg_replace( "/[\.\s]/", "" , $HTTP_POST_VARS[ $field ] ); - $HTTP_POST_VARS[ $field ] = preg_replace( "/,/" , '|', $HTTP_POST_VARS[ $field ] ); - } - - $HTTP_POST_VARS[ $field ] = preg_replace( "/'/", "'", stripslashes($HTTP_POST_VARS[ $field ]) ); - - $master[ $field ] = stripslashes($HTTP_POST_VARS[ $field ]); - } - - $ADMIN->rebuild_config($master); - } - } - - $ADMIN->done_screen("Forum Configurations updated", "Administration CP Home", "act=index" ); - - - - } - //------------------------------------------------------------- - // - // Common header: Saves writing the same stuff out over and over - // - //-------------------------------------------------------------- - - function common_header( $formcode = "", $section = "", $extra = "" ) - { - - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $extra = $extra ? $extra."
    " : $extra; - - $ADMIN->page_detail = $extra . "Please check the data you are entering before submitting the changes"; - $ADMIN->page_title = "Board Settings ($section)"; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $formcode ), - 2 => array( 'act' , 'op' ), - ) ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( "Settings" ); - - } - - //------------------------------------------------------------- - // - // Common footer: Saves writing the same stuff out over and over - // - //-------------------------------------------------------------- - - function common_footer( $button="Submit Changes" ) - { - - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - $ADMIN->output(); - - } -} - - + Admin Setting functions +| > Module written by Matt Mecham +| > Date started: 20th March 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'cookie': + $this->cookie(); + break; + case 'docookie': + $this->save_config( array( 'cookie_domain', 'cookie_id', 'cookie_path' ) ); + break; + //------------------------- + case 'secure': + $this->secure(); + break; + case 'dosecure': + $this->save_config( array ( 'reg_antispam', 'disable_admin_anon', 'disable_online_ip', 'disable_reportpost', 'allow_dynamic_img','session_expiration','match_browser','allow_dup_email','allow_images', 'force_login', 'no_reg', + 'allow_flash','new_reg_notify','use_mail_form','flood_control', 'allow_online_list', 'reg_auth_type' ) ); + break; + //------------------------- + case 'post': + $this->post(); + break; + case 'dopost': + $this->save_config( array ( 'poll_tags', 'guest_name_pre', 'guest_name_suf', 'max_w_flash', 'max_h_flash', 'hot_topic', 'display_max_topics','display_max_posts','max_emos','max_images','emo_per_row', 'etfilter_punct', 'etfilter_shout', + 'strip_quotes', 'max_post_length','show_img_upload','pre_polls','pre_moved','pre_pinned','img_ext' ) ); + break; + //------------------------- + case 'avatars': + $this->avatars(); + break; + case 'doavatars': + $this->save_config( array ( 'subs_autoprune', 'topicpage_contents', 'postpage_contents', 'allow_skins', 'max_sig_length', 'sig_allow_ibc', 'sig_allow_html','avatar_ext','avatar_url','avup_size_max','avatars_on','avatar_dims','avatar_def', 'max_location_length', 'max_interest_length', 'post_titlechange', 'guests_ava', 'guests_img', 'guests_sig' ) ); + break; + //------------------------- + case 'dates': + $this->dates(); + break; + case 'dodates': + $this->save_config( array ( 'time_offset','clock_short','clock_joined','clock_long', 'time_adjust' ) ); + break; + //------------------------- + + case 'calendar': + $this->calendar(); + break; + case 'docalendar': + $this->save_config( array ( 'show_calendar','calendar_limit', 'year_limit', 'start_year' ) ); + break; + //------------------------- + + case 'cpu': + $this->cpu(); + break; + case 'docpu': + $this->save_config( array ( 'no_au_forum', 'no_au_topic', 'au_cutoff', 'load_limit','show_active','show_birthdays','show_totals','allow_search', 'search_post_cut', 'show_user_posted', 'nocache' ) ); + break; + //------------------------- + case 'url': + $this->url(); + break; + case 'dourl': + $this->save_config( array ( 'safe_mode_skins', 'email_in','email_out','board_name','board_url','home_name','home_url', 'disable_gzip', + 'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug' ) ); + break; + //------------------------- + case 'pm': + $this->pm(); + break; + case 'dopm': + $this->save_config( array ( 'msg_allow_code', 'msg_allow_html' ) ); + break; + //------------------------- + case 'news': + $this->news(); + break; + case 'donews': + $this->save_config( array ( 'news_forum_id', 'index_news_link' ) ); + break; + //------------------------- + case 'coppa': + $this->coppa(); + break; + case 'docoppa': + $this->save_config( array ( 'use_coppa', 'coppa_fax', 'coppa_address' ) ); + break; + //------------------------- + case 'board': + $this->board(); + break; + case 'doboard': + $this->save_config( array ( 'board_offline', 'offline_msg' ) ); + break; + //------------------------- + case 'bw': + $this->badword(); + break; + case 'bw_add': + $this->add_badword(); + break; + case 'bw_remove': + $this->remove_badword(); + break; + case 'bw_edit': + $this->edit_badword(); + break; + case 'bw_doedit': + $this->doedit_badword(); + break; + //------------------------- + case 'emo': + $this->emoticons(); + break; + case 'emo_add': + $this->add_emoticons(); + break; + case 'emo_remove': + $this->remove_emoticons(); + break; + case 'emo_edit': + $this->edit_emoticons(); + break; + case 'emo_doedit': + $this->doedit_emoticons(); + break; + case 'emo_upload': + $this->upload_emoticon(); + //------------------------- + case 'count': + $this->countstats(); + break; + case 'docount': + $this->docount(); + break; + default: + $this->cookie(); + break; + } + + } + + //===================================================== + + //------------------------------------------------------------- + // NEWS + //-------------------------------------------------------------- + + function coppa() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('docoppa', 'COPPA Set-Up', 'You may change the configuration below. Note, enabling COPPA on your board will require children under the age of 13 to get parental consent via a faxed or mailed form.'); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Use COPPA registration system?" , + $SKIN->form_yes_no( "use_coppa", $INFO['use_coppa'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Fax number to receive COPPA forms" , + $SKIN->form_input( "coppa_fax", $form_array, $INFO['coppa_fax'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Mail address to receive COPPA forms" , + $SKIN->form_textarea( "coppa_address", $INFO['coppa_address'] ) + ) ); + + + $this->common_footer(); + + + } + + //===================================================== + + function docount() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ( (! $IN['posts']) and (! $IN['members'] ) and (! $IN['lastreg'] ) ) + { + $ADMIN->error("Nothing to recount!"); + } + + $stats = array(); + + if ($IN['posts']) + { + $DB->query("SELECT COUNT(pid) as posts FROM ibf_posts WHERE queued <> 1"); + $r = $DB->fetch_row(); + $stats['TOTAL_REPLIES'] = $r['posts']; + $stats['TOTAL_REPLIES'] < 1 ? 0 : $stats['TOTAL_REPLIES']; + + $DB->query("SELECT COUNT(tid) as topics FROM ibf_topics WHERE approved = 1"); + $r = $DB->fetch_row(); + $stats['TOTAL_TOPICS'] = $r['topics']; + $stats['TOTAL_TOPICS'] < 1 ? 0 : $stats['TOTAL_TOPICS']; + + $stats['TOTAL_REPLIES'] -= $stats['TOTAL_TOPICS']; + } + + if ($IN['members']) + { + $DB->query("SELECT COUNT(id) as members from ibf_members WHERE mgroup <> '".$INFO['auth_group']."'"); + $r = $DB->fetch_row(); + $stats['MEM_COUNT'] = $r['members']; + // Remove "guest" account... + $stats['MEM_COUNT']--; + $stats['MEM_COUNT'] < 1 ? 0 : $stats['MEM_COUNT']; + } + + if ($IN['lastreg']) + { + $DB->query("SELECT id, name FROM ibf_members WHERE mgroup <> '".$INFO['auth_group']."' ORDER BY id DESC LIMIT 0,1"); + $r = $DB->fetch_row(); + $stats['LAST_MEM_NAME'] = $r['name']; + $stats['LAST_MEM_ID'] = $r['id']; + } + + if ($IN['online']) + { + $stats['MOST_DATE'] = time(); + $stats['MOST_COUNT'] = 1; + } + + if ( count($stats) > 0 ) + { + $db_string = $DB->compile_db_update_string( $stats ); + $DB->query("UPDATE ibf_stats SET $db_string"); + } + else + { + $ADMIN->error("Nothing to recount!"); + } + + $ADMIN->done_screen("Statistics Recounted", "Administration CP Home", "act=index" ); + + } + + + + function countstats() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "Please choose which statistics to recount."; + $ADMIN->page_title = "Recount Statistics Control"; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'docount' ), + 2 => array( 'act' , 'op' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( "Statistic" , "70%" ); + $SKIN->td_header[] = array( "Option" , "30%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Recount Statistics" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Recount total topics and posts", + $SKIN->form_dropdown( 'posts', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Recount Members", + $SKIN->form_dropdown( 'members', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Reset last registered member", + $SKIN->form_dropdown( 'lastreg', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Reset 'Most online' statistic?", + $SKIN->form_dropdown( 'online', array( 0 => array( 0, 'No' ), 1 => array( 1, 'Yes' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->end_form('Reset these statistics'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // CALENDAR + //-------------------------------------------------------------- + + function calendar() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('docalendar', 'Calendar Set Up', 'You may change the configuration below'); + + $INFO['start_year'] = (isset($INFO['start_year'])) ? $INFO['start_year'] : 2001; + $INFO['year_limit'] = (isset($INFO['year_limit'])) ? $INFO['year_limit'] : 5; + + $ADMIN->html .= $SKIN->add_td_row( array( "Show forthcoming events?
    This will show calendar events on the board index page in the stats section." , + $SKIN->form_yes_no( "show_calendar", $INFO['show_calendar'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show forthcoming events from today to [x] days ahead
    This applies to the above option." , + $SKIN->form_input( "calendar_limit", $INFO['calendar_limit'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Starting year for calendar 'Year' drop down box
    This applies to view calendar / post event." , + $SKIN->form_input( "start_year", $INFO['start_year'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Year end limit for 'Year' drop down box
    This applies to view calendar / post event.
    Example: current year is 2002, you enter 5 - last choosable year = 2007" , + $SKIN->form_input( "year_limit", $INFO['year_limit'] ) + ) ); + + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // URLs and ADDRESSES + //-------------------------------------------------------------- + + function board() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('doboard', 'Board offline/online', 'You may change the configuration below'); + + $ADMIN->html .= $SKIN->add_td_row( array( "Turn the board offline?
    The board will still be accessable by those who have permission" , + $SKIN->form_yes_no( "board_offline", $INFO['board_offline'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "The offline message to display" , + $SKIN->form_textarea( "offline_msg", $INFO['offline_msg'] ) + ) ); + + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // EMOTICON FUNCTIONS + //------------------------------------------------------------- + + function doedit_emoticons() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['before'] == "") + { + $ADMIN->error("You must enter text to replace, silly!"); + } + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid emoticon id, silly!"); + } + + $IN['clickable'] = $IN['clickable'] ? 1 : 0; + + $db_string = $DB->compile_db_update_string( array( 'typed' => $IN['before'], + 'image' => $IN['after'], + 'clickable' => $IN['click'], + ) ); + + $DB->query("UPDATE ibf_emoticons SET $db_string WHERE id='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=op&code=emo"); + exit(); + + + } + + //===================================================== + + + function edit_emoticons() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You may edit the emoticon filter below"; + $ADMIN->page_title = "Edit Emoticon"; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid filter id, silly!"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_emoticons WHERE id='".$IN['id']."'"); + + if ( ! $r = $DB->fetch_row() ) + { + $ADMIN->error("We could not find that emoticon in the database"); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'emo_doedit' ), + 2 => array( 'act' , 'op' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + + + $SKIN->td_header[] = array( "Before" , "40%" ); + $SKIN->td_header[] = array( "After" , "40%" ); + $SKIN->td_header[] = array( "+ Clickable" , "20%" ); + + //+------------------------------- + + $emos = array(); + + if (! is_dir($INFO['html_dir'].'emoticons') ) + { + $ADMIN->error("Could not locate the emoticons directory - make sure the 'html_dir' path is set correctly"); + } + + //+------------------------------- + + + $dh = opendir( $INFO['html_dir'].'emoticons' ) or die("Could not open the emoticons directory for reading, check paths and permissions"); + while ( $file = readdir( $dh ) ) + { + if ( !preg_match( "/^..?$|^index|htm$|html$|^\./i", $file ) ) + { + $emos[] = array( $file, $file ); + } + } + closedir( $dh ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Edit an Emoticon" ); + + $ADMIN->html .= " + "; + + $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before', stripslashes($r['typed']) ), + $SKIN->form_dropdown('after', $emos, $r['image'], "onChange='show_emo()'") . "  ", + $SKIN->form_dropdown( 'click', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ), $r['clickable'] ) + ) ); + + $ADMIN->html .= $SKIN->end_form('Edit Emoticon'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //===================================================== + + function remove_emoticons() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid emoticon id, silly!"); + } + + $DB->query("DELETE FROM ibf_emoticons WHERE id='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=op&code=emo"); + exit(); + + + } + + //===================================================== + + function add_emoticons() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['before'] == "") + { + $ADMIN->error("You must enter an emoticon text to replace, silly!"); + } + + $IN['click'] = $IN['click'] ? 1 : 0; + + $db_string = $DB->compile_db_insert_string( array( 'typed' => $IN['before'], + 'image' => $IN['after'], + 'clickable' => $IN['click'], + ) ); + + $DB->query("INSERT INTO ibf_emoticons (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + $std->boink_it($SKIN->base_url."&act=op&code=emo"); + exit(); + + + } + + + function perly_length_sort($a, $b) + { + if ( strlen($a['typed']) == strlen($b['typed']) ) + { + return 0; + } + return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1; + } + + function perly_word_sort($a, $b) + { + if ( strlen($a['type']) == strlen($b['type']) ) + { + return 0; + } + return ( strlen($a['type']) > strlen($b['type']) ) ? -1 : 1; + } + + //===================================================== + + function upload_emoticon() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_FILES; + + $FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name']; + $FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size']; + $FILE_TYPE = $HTTP_POST_FILES['FILE_UPLOAD']['type']; + + // Naughty Opera adds the filename on the end of the + // mime type - we don't want this. + + $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); + + if (! is_dir($INFO['html_dir'].'emoticons') ) + { + $ADMIN->error("Could not locate the emoticons directory - make sure the 'html_dir' path is set correctly"); + } + + // Naughty Mozilla likes to use "none" to indicate an empty upload field. + // I love universal languages that aren't universal. + + if ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "" or !$HTTP_POST_FILES['FILE_UPLOAD']['name'] or ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "none") ) + { + $ADMIN->error("No file was chosen to upload!"); + } + + //------------------------------------------------- + // Copy the upload to the uploads directory + //------------------------------------------------- + + if (! @move_uploaded_file( $HTTP_POST_FILES['FILE_UPLOAD']['tmp_name'], $INFO['html_dir'].'emoticons'."/".$FILE_NAME) ) + { + $ADMIN->error("The upload failed"); + } + else + { + @chmod( $INFO['html_dir'].'emoticons'."/".$FILE_NAME, 0777 ); + } + + $std->boink_it($SKIN->base_url."&act=op&code=emo"); + exit(); + + + } + + function emoticons() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You may add/edit or remove emoticons in this section.
    You can only choose emoticons that have been uploaded into the 'html/emoticons' directory.

    Clickable refers to emoticons that are in the posting screens 'Clickable Emoticons' table."; + $ADMIN->page_title = "Emoticon Control"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Before" , "30%" ); + $SKIN->td_header[] = array( "After" , "30%" ); + $SKIN->td_header[] = array( "+ Clickable" , "20%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + //+------------------------------- + + + + $ADMIN->html .= $SKIN->start_table( "Current Emoticons" ); + + $DB->query("SELECT * from ibf_emoticons"); + + $emo_url = $INFO['html_url'] . '/emoticons'; + + $smilies = array(); + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + $smilies[] = $r; + } + + usort($smilies, array( 'ad_settings', 'perly_length_sort' ) ); + + foreach( $smilies as $array_idx => $r ) + { + + $click = $r['clickable'] ? 'Yes' : 'No'; + + $ADMIN->html .= $SKIN->add_td_row( array( stripslashes($r['typed']), + "
    ", + "
    $click
    ", + "
    Edit
    ", + "
    Remove
    ", + ) ); + + + + } + } + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + + $emos = array(); + + if (! is_dir($INFO['html_dir'].'emoticons') ) + { + $ADMIN->error("Could not locate the emoticons directory - make sure the 'html_dir' path is set correctly"); + } + + //+------------------------------- + + $cnt = 0; + $start = ""; + + $dh = opendir( $INFO['html_dir'].'emoticons' ) or die("Could not open the emoticons directory for reading, check paths and permissions"); + while ( $file = readdir( $dh ) ) + { + if ( !preg_match( "/^..?$|^index|htm$|html$|^\./i", $file ) ) + { + $emos[] = array( $file, $file ); + + if ($cnt == 0) + { + $cnt = 1; + $start = $file; + } + } + } + closedir( $dh ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'emo_add' ), + 2 => array( 'act' , 'op' ), + ) ); + + + $SKIN->td_header[] = array( "Before" , "40%" ); + $SKIN->td_header[] = array( "After" , "40%" ); + $SKIN->td_header[] = array( "+ Clickable" , "20%" ); + + //+------------------------------- + + $ADMIN->html .= " + "; + + $ADMIN->html .= $SKIN->start_table( "Add a new Emoticon" ); + + $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before'), + $SKIN->form_dropdown('after', $emos, "", "onChange='show_emo()'") . "  ", + $SKIN->form_dropdown( 'click', array( 0 => array( 1, 'Yes' ), 1 => array( 0, 'No' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->end_form('Add Emoticon'); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'emo_upload' ), + 2 => array( 'act' , 'op' ), + 3 => array( 'MAX_FILE_SIZE', '10000000000' ), + ) , "uploadform", " enctype='multipart/form-data'" ); + + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + + $ADMIN->html .= $SKIN->start_table( "Upload an Emoticon to the emoticons directory" ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Choose a file from your computer to upload
    After uploading, the emoticon will be selectable from the form above.", + $SKIN->form_upload(), + ) ); + + $ADMIN->html .= $SKIN->end_form('Upload Emoticon'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // BADWORD FUNCTIONS + //-------------------------------------------------------------- + + + function doedit_badword() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['before'] == "") + { + $ADMIN->error("You must enter a word to replace, silly!"); + } + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid filter id, silly!"); + } + + $IN['match'] = $IN['match'] ? 1 : 0; + + strlen($IN['swop']) > 1 ? $IN['swop'] : ""; + + $db_string = $DB->compile_db_update_string( array( 'type' => $IN['before'], + 'swop' => $IN['after'], + 'm_exact' => $IN['match'], + ) ); + + $DB->query("UPDATE ibf_badwords SET $db_string WHERE wid='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=op&code=bw"); + exit(); + + + } + + //===================================================== + + function edit_badword() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You may edit the chosen filter below"; + $ADMIN->page_title = "Bad Word Filter"; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid filter id, silly!"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_badwords WHERE wid='".$IN['id']."'"); + + if ( ! $r = $DB->fetch_row() ) + { + $ADMIN->error("We could not find that filter in the database"); + } + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'bw_doedit' ), + 2 => array( 'act' , 'op' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + + + $SKIN->td_header[] = array( "Before" , "40%" ); + $SKIN->td_header[] = array( "After" , "40%" ); + $SKIN->td_header[] = array( "Method" , "20%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Edit a filter" ); + + $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before', stripslashes($r['type']) ), + $SKIN->form_input('after' , stripslashes($r['swop']) ), + $SKIN->form_dropdown( 'match', array( 0 => array( 1, 'Exact' ), 1 => array( 0, 'Loose' ) ), $r['m_exact'] ) + ) ); + + $ADMIN->html .= $SKIN->end_form('Edit Filter'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //===================================================== + + function remove_badword() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must pass a valid filter id, silly!"); + } + + $DB->query("DELETE FROM ibf_badwords WHERE wid='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=op&code=bw"); + exit(); + + + } + + //===================================================== + + function add_badword() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['before'] == "") + { + $ADMIN->error("You must enter a word to replace, silly!"); + } + + $IN['match'] = $IN['match'] ? 1 : 0; + + strlen($IN['swop']) > 1 ? $IN['swop'] : ""; + + $db_string = $DB->compile_db_insert_string( array( 'type' => $IN['before'], + 'swop' => $IN['after'], + 'm_exact' => $IN['match'], + ) ); + + $DB->query("INSERT INTO ibf_badwords (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + $std->boink_it($SKIN->base_url."&act=op&code=bw"); + exit(); + + + } + + //===================================================== + + function badword() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_detail = "You can add/edit and remove bad word filters in this section.
    The badword filter allows you to globally replace words from a members post, signature and topic title.

    Loose matching: If you entered 'hell' as a bad word, it will replace 'hell' and 'hello' with either your replacement if entered or 6 hashes (case insensitive)

    Exact matching: If you entered 'hell' as a bad word, it will replace 'hell' only with either your replacement if entered or 6 hashes (case insensitive)"; + $ADMIN->page_title = "Bad Word Filter"; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'bw_add' ), + 2 => array( 'act' , 'op' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( "Before" , "30%" ); + $SKIN->td_header[] = array( "After" , "30%" ); + $SKIN->td_header[] = array( "Method" , "20%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Current Filters" ); + + $DB->query("SELECT * from ibf_badwords"); + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + $words[] = $r; + } + + usort($words, array( 'ad_settings', 'perly_word_sort' ) ); + + foreach($words as $idx => $r) + { + + $replace = $r['swop'] ? stripslashes($r['swop']) : '######'; + + $method = $r['m_exact'] ? 'Exact' : 'Loose'; + + $ADMIN->html .= $SKIN->add_td_row( array( stripslashes($r['type']), + $replace, + $method, + "
    Edit
    ", + "
    Remove
    ", + ) ); + } + + } + + $ADMIN->html .= $SKIN->end_table(); + + + $SKIN->td_header[] = array( "Before" , "40%" ); + $SKIN->td_header[] = array( "After" , "40%" ); + $SKIN->td_header[] = array( "Method" , "20%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Add a new filter" ); + + $ADMIN->html .= $SKIN->add_td_row( array( $SKIN->form_input('before'), + $SKIN->form_input('after'), + $SKIN->form_dropdown( 'match', array( 0 => array( 1, 'Exact' ), 1 => array( 0, 'Loose' ) ) ) + ) ); + + $ADMIN->html .= $SKIN->end_form('Add Filter'); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // NEWS + //-------------------------------------------------------------- + + function news() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('donews', 'News Export Set-Up', 'You may change the configuration below'); + + $DB->query("SELECT id, name FROM ibf_forums WHERE subwrap = 0"); + + $form_array = array(); + + while ( $r = $DB->fetch_row() ) + { + $form_array[] = array( $r['id'], $r['name'] ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Export news topics from which forum?" , + $SKIN->form_dropdown( "news_forum_id", $form_array, $INFO['news_forum_id'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show a 'Latest News' link on the board index?" , + $SKIN->form_yes_no( "index_news_link", $INFO['index_news_link'] ) + ) ); + + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // PM + //-------------------------------------------------------------- + + function pm() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('dopm', 'Messenger Set up', 'You may change the configuration below'); + + + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow IBF Code in messages?" , + $SKIN->form_yes_no( "msg_allow_code", $INFO['msg_allow_code'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow HTML in messages?" , + $SKIN->form_yes_no( "msg_allow_html", $INFO['msg_allow_html'] ) + ) ); + + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // URLs and ADDRESSES + //-------------------------------------------------------------- + + function url() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('dourl', 'URL\'s, Paths and Addresses', 'You may change the configuration below'); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Board incoming email address" , + $SKIN->form_input( "email_in", $INFO['email_in'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Board outgoing email address" , + $SKIN->form_input( "email_out", $INFO['email_out'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Board Name" , + $SKIN->form_input( "board_name", $INFO['board_name'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Board Address" , + $SKIN->form_input( "board_url", $INFO['board_url'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Website Name" , + $SKIN->form_input( "home_name", $INFO['home_name'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Website Address" , + $SKIN->form_input( "home_url", $INFO['home_url'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "HTML URL
    For images, etc" , + $SKIN->form_input( "html_url", $INFO['html_url'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Upload URL" , + $SKIN->form_input( "upload_url", $INFO['upload_url'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Upload Directory" , + $SKIN->form_input( "upload_dir", $INFO['upload_dir'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Print HTTP headers?
    (Some NT installs require this off)" , + $SKIN->form_yes_no( "print_headers", $INFO['print_headers'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "DISABLE GZIP encoding?
    (GZIP enables faster page transfer and lower bandwidth use)" , + $SKIN->form_yes_no( "disable_gzip", $INFO['disable_gzip'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "ENABLE SQL Debug Mode?
    (If yes, add '&debug=1' to any page to view mySQL debug info)" , + $SKIN->form_yes_no( "sql_debug", $INFO['sql_debug'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Type of auto-redirect?
    (This is for quick no page redirects)" , + $SKIN->form_dropdown( 'header_redirect', + array( + 0 => array( 'location', 'Location type (*nix savvy)' ), + 1 => array( 'refresh' , 'Refresh (Windows savvy)' ), + 2 => array( 'html' , 'HTML META redirect (If all else fails...)' ), + ), + $INFO['header_redirect'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Debug level" , + $SKIN->form_dropdown( "debug_level", + array( + 0 => array( 0, '0: None - Don\'t show any debug information' ), + 1 => array( 1, '1: Show server load, page generation times and query count' ), + 2 => array( 2, '2: Show level 1 (above) and GET and POST information'), + 3 => array( 3, '3: Show level 1 + 2 and database queries'), + ), + $INFO['debug_level'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Use safe mode skins?
    (Note: You may need to resynchronise your template sets after changing this if you have custom/edited skins)" , + $SKIN->form_dropdown( 'safe_mode_skins', + array( + 0 => array( '0', 'No' ), + 1 => array( '1' , 'Yes' ), + ), + $INFO['safe_mode_skins'] ) + ) ); + + + $this->common_footer(); + + + } + + + + //------------------------------------------------------------- + // CPU SAVING + //-------------------------------------------------------------- + + function cpu() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('docpu', 'CPU Saving', 'You can opt to turn some features off to minimize the resource footprint'); + + + if ($INFO['au_cutoff'] == "") + { + $INFO['au_cutoff'] = 15; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Server Load Limit
    Will display 'busy' message when limit hit
    Can be left blank for no limit" , + $SKIN->form_input( "load_limit", $INFO['load_limit'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show Active Users?" , + $SKIN->form_yes_no( "show_active", $INFO['show_active'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Cut off for active user display in minutes" , + $SKIN->form_input( "au_cutoff", $INFO['au_cutoff'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show Birthdays?" , + $SKIN->form_yes_no( "show_birthdays", $INFO['show_birthdays'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show Board Totals?" , + $SKIN->form_yes_no( "show_totals", $INFO['show_totals'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow users (where allowed) to use search?" , + $SKIN->form_yes_no( "allow_search", $INFO['allow_search'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Cut search post to [x] characters
    Refers to when returning search results as posts" , + $SKIN->form_input( "search_post_cut", $INFO['search_post_cut'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Mark topics a user has posted when displaying a forum?" , + $SKIN->form_yes_no( "show_user_posted", $INFO['show_user_posted'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Print HTTP no-cache headers?
    (This will stop browsers caching pages)" , + $SKIN->form_yes_no( "nocache", $INFO['nocache'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Remove 'Users Browsing this forum' feature?
    (This save 1 query per forum view)" , + $SKIN->form_yes_no( "no_au_forum", $INFO['no_au_forum'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Remove 'Users Browsing this topic' feature?
    (This save 1 query per topic view)" , + $SKIN->form_yes_no( "no_au_topic", $INFO['no_au_topic'] ) + ) ); + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // DATES + //-------------------------------------------------------------- + + function dates() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('dodates', 'Dates', 'Define date formats'); + + $time_array = array(); + + require $root_path."lang/en/lang_ucp.php"; + + foreach( $lang as $off => $words ) + { + if (preg_match("/^time_(\S+)$/", $off, $match)) + { + $time_select[] = array( $match[1], $words ); + } + } + + $d_date = $std->get_date(time(), 'LONG'); + + $ADMIN->html .= $SKIN->add_td_row( array( "Native Server Time Zone
    If you have chosen the correct timezone and the clock is an hour out, this is because of daylight savings time and your members can correct this by editing their 'Board settings' via their User Control Panel." , + $SKIN->form_dropdown( "time_offset", $time_select, $INFO['time_offset'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Server Time Adjustment (in minutes)
    You fine tune the server time. If you need to subtract minutes from the server time, start the number with a '-' (no quotes)." , + $SKIN->form_input( "time_adjust", $INFO['time_adjust'] ) . "
    Board time (inc. above time zone and current adj.) is now: $d_date" + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Short time format
    Same configuration as PHP Date" , + $SKIN->form_input( "clock_short", $INFO['clock_short'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Join date time format
    Same configuration as PHP Date" , + $SKIN->form_input( "clock_joined", $INFO['clock_joined'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Long time format
    Same configuration as PHP Date" , + $SKIN->form_input( "clock_long", $INFO['clock_long'] ) + ) ); + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // AVATARS + //-------------------------------------------------------------- + + function avatars() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('doavatars', 'User Profiles', 'Define user profile permissions'); + + $INFO['avatar_ext'] = preg_replace( "/\|/", ",", $INFO['avatar_ext'] ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow members to choose skins?" , + $SKIN->form_yes_no( "allow_skins", $INFO['allow_skins'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow the use of avatars?" , + $SKIN->form_yes_no( "avatars_on", $INFO['avatars_on'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allowed image extensions
    Seperate with comma (gif,png,jpeg) etc" , + $SKIN->form_input( "avatar_ext", $INFO['avatar_ext'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow users to use remote URL avatars?" , + $SKIN->form_yes_no( "avatar_url", $INFO['avatar_url'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. file size for avatar uploads? (K)" , + $SKIN->form_input( "avup_size_max", $INFO['avup_size_max'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Maximum avatar dimensions
    (WIDTHxHEIGHT)" , + $SKIN->form_input( "avatar_dims", $INFO['avatar_dims'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Default sizes for gallery avatars
    (WIDTHxHEIGHT)" , + $SKIN->form_input( "avatar_def", $INFO['avatar_def'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "No. of posts a user must have before change of member title is allowed?" , + $SKIN->form_input( "post_titlechange", $INFO['post_titlechange'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for the location field entry" , + $SKIN->form_input( "max_location_length", $INFO['max_location_length'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for the interests field entry" , + $SKIN->form_input( "max_interest_length", $INFO['max_interest_length'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Maximum length (in bytes) for user signatures" , + $SKIN->form_input( "max_sig_length", $INFO['max_sig_length'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow HTML in signatures?" , + $SKIN->form_yes_no( "sig_allow_html", $INFO['sig_allow_html'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow IBF Code in signatures?" , + $SKIN->form_yes_no( "sig_allow_ibc", $INFO['sig_allow_ibc'] ) + ) ); + + //-------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view signatures?" , + $SKIN->form_yes_no( "guests_sig", $INFO['guests_sig'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view posted images?" , + $SKIN->form_yes_no( "guests_img", $INFO['guests_img'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow GUESTS to view user avatars?" , + $SKIN->form_yes_no( "guests_ava", $INFO['guests_ava'] ) + ) ); + + //-------- + + if ($INFO['postpage_contents'] == "") + { + $INFO['postpage_contents'] = '5,10,15,20,25,30,35,40'; + } + + if ($INFO['topicpage_contents'] == "") + { + $INFO['topicpage_contents'] = '5,10,15,20,25,30,35,40'; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "User selectable posts per page dropdown contents
    Separate with a comma, 'Use forum default' added automatically
    Example: 5,15,20,25,30" , + $SKIN->form_input( "postpage_contents", $INFO['postpage_contents'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "User selectable topics per forum page dropdown contents
    Separate with a comma, 'Use forum default' added automatically
    Example: 5,15,20,25,30" , + $SKIN->form_input( "topicpage_contents", $INFO['topicpage_contents'] ) + ) ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Auto prune all topic subscriptions if the topic has no replies over [x] days
    Leave blank for no auto prune limit" , + $SKIN->form_input( "subs_autoprune", $INFO['subs_autoprune'] ) + ) ); + + + $this->common_footer(); + + + } + + + //------------------------------------------------------------- + // TOPICS and POSTS + //-------------------------------------------------------------- + + function post() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $INFO['img_ext'] = preg_replace( "/\|/", ",", $INFO['img_ext'] ); + + $this->common_header('dopost', 'Topics, Posts and Posting', 'Configure the viewable post elements and limits.'); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of topics per forum page" , + $SKIN->form_input( "display_max_topics", $INFO['display_max_topics'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of posts per topic page" , + $SKIN->form_input( "display_max_posts", $INFO['display_max_posts'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Number of posts needed to make a 'hot topic'?" , + $SKIN->form_input( "hot_topic", $INFO['hot_topic'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "No. emoticons per clickable table row" , + $SKIN->form_input( "emo_per_row", $INFO['emo_per_row'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. no. emoticons per post" , + $SKIN->form_input( "max_emos", $INFO['max_emos'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. no. images per post" , + $SKIN->form_input( "max_images", $INFO['max_images'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. size of post (in kilobytes [k])" , + $SKIN->form_input( "max_post_length", $INFO['max_post_length'] ) + ) ); + + // + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. width of posted Flash movies (in pixels)" , + $SKIN->form_input( "max_w_flash", $INFO['max_w_flash'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Max. height of posted Flash movies (in pixels)" , + $SKIN->form_input( "max_h_flash", $INFO['max_h_flash'] ) + ) ); + + // + + $ADMIN->html .= $SKIN->add_td_row( array( "Valid postable image extensions
    (Seperate with comma (gif,jpeg,jpg) etc" , + $SKIN->form_input( "img_ext", $INFO['img_ext'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Show uploaded images in post?" , + $SKIN->form_yes_no( "show_img_upload", $INFO['show_img_upload'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for PINNED topics" , + $SKIN->form_input( "pre_pinned", $INFO['pre_pinned'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for MOVED topics" , + $SKIN->form_input( "pre_moved", $INFO['pre_moved'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Topic prefix for POLLS" , + $SKIN->form_input( "pre_polls", $INFO['pre_polls'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow [IMG] and [URL] tags in polls?" , + $SKIN->form_yes_no( "poll_tags", $INFO['poll_tags'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Stop shouting in topic titles?
    (Will turn: CLICK HERE into Click Here)" , + $SKIN->form_yes_no( "etfilter_shout", $INFO['etfilter_shout'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Remove excess exclamation/question marks in topic titles?
    (Will turn: This!!!!! into This!)" , + $SKIN->form_yes_no( "etfilter_punct", $INFO['etfilter_punct'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Stop Quote Embedding?
    This will remove any quoted text when quoting a post that contains quotes
    .." , + $SKIN->form_yes_no( "strip_quotes", $INFO['strip_quotes'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Guest names prefix
    (This is for when a guest posts with a members name, it allows for a visual difference to prevent confusion)" , + $SKIN->form_input( "guest_name_pre", $INFO['guest_name_pre'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Guest names suffix
    (This is for when a guest posts with a members name, it allows for a visual difference to prevent confusion)" , + $SKIN->form_input( "guest_name_suf", $INFO['guest_name_suf'] ) + ) ); + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // SECURITY + //-------------------------------------------------------------- + + function secure() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('dosecure', 'Security', 'Define the level of security your board possess by using the configurations below'); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow dynamic images?
    If 'yes' users can post scripted image generators" , + $SKIN->form_yes_no( "allow_dynamic_img", $INFO['allow_dynamic_img'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Session Expiration (in seconds)
    Removes inactive sessions over the limit you specify" , + $SKIN->form_input( "session_expiration", $INFO['session_expiration'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Match users browsers while validating?" , + $SKIN->form_yes_no( "match_browser", $INFO['match_browser'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow duplicate emails when user registers?
    Will not check for existing email address" , + $SKIN->form_yes_no( "allow_dup_email", $INFO['allow_dup_email'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow images to be posted?
    Advanced programmers can force images to run as scripts. IBF limits damage by this method however." , + $SKIN->form_yes_no( "allow_images", $INFO['allow_images'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow flash movies in posts and avatars?
    Flash has a built in scripting language" , + $SKIN->form_yes_no( "allow_flash", $INFO['allow_flash'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "New registration email validation?
    Make admin manually preview all new accounts or make new users validate their email address" , + $SKIN->form_dropdown( "reg_auth_type", + array( + 0 => array( 'user' , 'User Email Validation' ), + 1 => array( 'admin', 'Admin Validation' ), + 2 => array( '0' , 'None' ) + ), + $INFO['reg_auth_type'] + ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Get notified when a new user registers via email?" , + $SKIN->form_dropdown( "new_reg_notify", + array( + 0 => array( '1' , 'Yes' ), + 1 => array( '0' , 'No' ) + ), + $INFO['new_reg_notify'] + ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Enable Registration Bot Flood Control?
    Forces users to input a random code to prevent bot's from spamming the registration.".$SKIN->js_help_link('s_reg_antispam') , + $SKIN->form_yes_no( "reg_antispam", $INFO['reg_antispam'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Use secure mail form for member to member mails?
    Hides users email addresses" , + $SKIN->form_yes_no( "use_mail_form", $INFO['use_mail_form'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Flood control delay (in seconds)
    Make users wait before posting again
    Can be left blank for no flood control" , + $SKIN->form_input( "flood_control", $INFO['flood_control'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Allow users to browse the Active Users list?" , + $SKIN->form_yes_no( "allow_online_list", $INFO['allow_online_list'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Disable root admin group viewing anonymous online users?
    Anonymous users have an asterisk after their name" , + $SKIN->form_yes_no( "disable_admin_anon", $INFO['disable_admin_anon'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Disable root admin group viewing online users IP address in online user list?" , + $SKIN->form_yes_no( "disable_online_ip", $INFO['disable_online_ip'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Force guests to log in before allowing access to the board?" , + $SKIN->form_yes_no( "force_login", $INFO['force_login'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Disable new registrations?" , + $SKIN->form_yes_no( "no_reg", $INFO['no_reg'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Disable 'Report this post to a moderator' link?" , + $SKIN->form_yes_no( "disable_reportpost", $INFO['disable_reportpost'] ) + ) ); // + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // COOKIES: Yum Yum! + //-------------------------------------------------------------- + + function cookie() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->common_header('docookie', 'Cookies', 'All of these fields can be left blank. Experiment to find the correct settings for your host'); + + $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Domain
    Hint: use .your-domain.com for global cookies" , + $SKIN->form_input( "cookie_domain", $INFO['cookie_domain'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Name Prefix
    Allows multiple boards on one host." , + $SKIN->form_input( "cookie_id", $INFO['cookie_id'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Cookie Path
    Relative path from domain to root IBF dir" , + $SKIN->form_input( "cookie_path", $INFO['cookie_path'] ) + ) ); + + $this->common_footer(); + + + } + + //------------------------------------------------------------- + // + // Save config. Does the hard work, so you don't have to. + // + //-------------------------------------------------------------- + + function save_config( $new ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + $master = array(); + + if ( is_array($new) ) + { + if ( count($new) > 0 ) + { + foreach( $new as $field ) + { + + // Handle special.. + + if ($field == 'img_ext' or $field == 'avatar_ext') + { + $HTTP_POST_VARS[ $field ] = preg_replace( "/[\.\s]/", "" , $HTTP_POST_VARS[ $field ] ); + $HTTP_POST_VARS[ $field ] = preg_replace( "/,/" , '|', $HTTP_POST_VARS[ $field ] ); + } + else if ($field == 'coppa_address') + { + $HTTP_POST_VARS[ $field ] = nl2br( $HTTP_POST_VARS[ $field ] ); + } + + $HTTP_POST_VARS[ $field ] = preg_replace( "/'/", "'", stripslashes($HTTP_POST_VARS[ $field ]) ); + + $master[ $field ] = stripslashes($HTTP_POST_VARS[ $field ]); + } + + $ADMIN->rebuild_config($master); + } + } + + $ADMIN->save_log("Board Settings Updated, Back Up Written"); + + $ADMIN->done_screen("Forum Configurations updated", "Administration CP Home", "act=index" ); + + + + } + //------------------------------------------------------------- + // + // Common header: Saves writing the same stuff out over and over + // + //-------------------------------------------------------------- + + function common_header( $formcode = "", $section = "", $extra = "" ) + { + + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $extra = $extra ? $extra."
    " : $extra; + + $ADMIN->page_detail = $extra . "Please check the data you are entering before submitting the changes"; + $ADMIN->page_title = "Board Settings ($section)"; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $formcode ), + 2 => array( 'act' , 'op' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Settings" ); + + } + + //------------------------------------------------------------- + // + // Common footer: Saves writing the same stuff out over and over + // + //-------------------------------------------------------------- + + function common_footer( $button="Submit Changes" ) + { + + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_skin_import.php b/upload/sources/Admin/ad_skin_import.php index 8ef112bb..7f6071c1 100644 --- a/upload/sources/Admin/ad_skin_import.php +++ b/upload/sources/Admin/ad_skin_import.php @@ -1,1161 +1,1043 @@ - Import functions -| > Module written by Matt Mecham -| > Date started: 22nd April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - -$idx = new ad_langs(); - - -class ad_langs { - - var $base_url; - - function ad_langs() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - - case 'doimport': - $this->doimport(); - break; - - case 'import': - $this->import(); - break; - - case 'remove': - $this->remove(); - break; - - - //------------------------- - default: - $this->list_current(); - break; - } - - } - - - //--------------------------------------------- - // Remove archived files - //--------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You did not select a tar-chive to import!"); - } - - $this->tar_with_path = $INFO['base_dir']."archive_in/".$IN['id']; - - if ( ! unlink($this->tar_with_path) ) - { - $ADMIN->error("Could not remove that file, please check the CHMOD permissions"); - } - - $std->boink_it($ADMIN->base_url."&act=import"); - exit(); - - - } - - - //--------------------------------------------- - // Import switcheroo - //--------------------------------------------- - - function import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You did not select a tar-chive to import!"); - } - - $this->tar_with_path = $INFO['base_dir']."archive_in/".$IN['id']; - - $this->work_path = $INFO['base_dir']."archive_in"; - - if (! file_exists($this->tar_with_path) ) - { - $ADMIN->error( "That archive is not found on the server, it may have been deleted by another admin"); - } - - $this->tar_file = $IN['id']; - - $this->name_translated = preg_replace( "/^(css|image|set|wrap|tmpl)-(.+?)\.(\S+)$/", "\\2", $this->tar_file ); - $this->name_translated = preg_replace( "/_/", " ", $this->name_translated ); - - require $root_dir."sources/lib/tar.php"; - - $this->tar = new tar(); - - switch($IN['type']) - { - case 'css': - $this->css_import(); - break; - - case 'wrap': - $this->wrap_import(); - break; - - case 'image': - $this->image_import(); - break; - - case 'tmpl': - $this->template_import(); - break; - case 'set': - $this->set_import(); - break; - - //--------- - default: - $ADMIN->error("Unrecognised archive type"); - break; - } - - - } - - function set_import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $templates_dir = $INFO['base_dir']."style_templates"; - $images_dir = $INFO['base_dir']."style_images"; - $css_dir = $INFO['base_dir']."style_sheets"; - $skins_dir = $INFO['base_dir']."Skin"; - - if (! is_writeable($images_dir) ) - { - $ADMIN->error("Cannot write to the $images_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - if (! is_writeable($css_dir) ) - { - $ADMIN->error("Cannot write to the $css_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - if (! is_dir($templates_dir) ) - { - $ADMIN->error("Cannot write to the $templates_dir directory, It is not there."); - } - - if (! is_writeable($templates_dir) ) - { - $ADMIN->error("Cannot write to the $templates_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - if (! is_dir($skins_dir) ) - { - $ADMIN->error("Cannot write to the $skins_dir directory, It is not there."); - } - - if (! is_writeable($skins_dir) ) - { - $ADMIN->error("Cannot write to the $skins_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - //------------------------------------------------------ - - $this->tar->new_tar( $this->work_path, $this->tar_file ); - - $files = $this->tar->list_files(); - - if (! $this->check_archive($files) ) - { - $ADMIN->error("That is not a valid tar-achive, please re-upload in binary and try again"); - } - - //------------------------------------------------------ - - $DB->query("SELECT COUNT(*) as count FROM ibf_tmpl_names"); - - $tmpl_count = $DB->fetch_row(); - - //------------------------------------------------------ - // Attempt to create a new work directory - //------------------------------------------------------ - - $new_dir = preg_replace( "/^(.+?)\.tar$/", "\\1", $this->tar_file ); - - $this->new_dir = $new_dir; - - if ( ! mkdir($this->work_path."/".$new_dir, 0777) ) - { - $ADMIN->error("Directory creation failed, cannot import skin set. Please check the permission in 'archive_in'"); - } - - @chmod($this->work_path."/".$new_dir, 0777); - - $next_id = array( 'css' => 0, 'wrap' => 0, 'templates' => 0, 'images' => 0 ); - - //------------------------------------------------------ - // Add a dummy entries into the DB to get the next insert ID - //------------------------------------------------------ - - $DB->query("INSERT INTO ibf_tmpl_names SET skname=\"".$this->name_translated." (Set Import).{$tmpl_count['count']}\""); - - $next_id['templates'] = $DB->get_insert_id(); - - //------------------------------------------------------ - - $DB->query("INSERT INTO ibf_css SET css_name=\"".$this->name_translated." (Set Import)\""); - - $next_id['css'] = $DB->get_insert_id(); - - //------------------------------------------------------ - - $DB->query("INSERT INTO ibf_templates SET name=\"".$this->name_translated." (Set Import)\""); - - $next_id['wrap'] = $DB->get_insert_id(); - - //------------------------------------------------------ - - $DB->query("INSERT INTO ibf_images SET setname=\"".$this->name_translated." (Set Import)\""); - - $next_id['images'] = $DB->get_insert_id(); - - //------------------------------------------------------ - // Attempt to create the new directories - //------------------------------------------------------ - - if (! mkdir($templates_dir."/".$next_id['templates'], 0777) ) - { - $this->import_error("Could not create a new directory in style_templates", $next_id); - } - - @chmod($templates_dir."/".$next_id['templates'], 0777); - - //----------------------------------------------------- - - if (! mkdir($images_dir."/".$next_id['images'], 0777) ) - { - $this->import_error("Could not create a new directory in style_images", $next_id); - } - - @chmod($images_dir."/".$next_id['images'], 0777); - - //----------------------------------------------------- - - if (! mkdir($skins_dir."/s".$next_id['templates'], 0777) ) - { - $this->import_error("Could not create a new directory in Skin", $next_id); - } - - @chmod($skins_dir."/s".$next_id['templates'], 0777); - - //------------------------------------------------------ - - $this->tar->extract_files($this->work_path."/".$new_dir); - - if ($this->tar->error != "") - { - $this->import_error($this->tar->error, $next_id); - } - - //------------------------------------------------------ - // Make sure config file is present and correct and stuff - //------------------------------------------------------ - - if ( ! file_exists($this->work_path."/".$new_dir."/templates/config.php") ) - { - $this->import_error("Master template set configuration file 'config.php' is missing from this archive, terminating import", $next_id); - } - - //------------------------------------------------------ - - if ( ! file_exists($this->work_path."/".$new_dir."/img_conf.inc") ) - { - $this->import_error("Image and macro set configuration file 'img_conf.inc' is missing from this archive, terminating import", $next_id); - } - - require $this->work_path."/".$new_dir."/img_conf.inc"; - - $image_config = $config; - - unset($config); - - //------------------------------------------------------ - - if ( file_exists($this->work_path."/".$new_dir."/templates_conf.inc") ) - { - require $this->work_path."/".$new_dir."/templates_conf.inc"; - - $template_config = array( 'author' => stripslashes($config['author']), - 'email' => stripslashes($config['email']), - 'url' => stripslashes($config['url']), - ); - - $skin_set_config = array( - 'tbl_width' => stripslashes($config['tbl_width']), - 'tbl_border' => stripslashes($config['tbl_border']), - ); - - $db_string = $DB->compile_db_update_string( $template_config ); - - $DB->query("UPDATE ibf_tmpl_names SET $db_string WHERE skid='{$next_id['templates']}'"); - } - - //------------------------------------------------------ - // Import the CSS - //------------------------------------------------------ - - if ($FH = fopen( $this->work_path."/".$new_dir."/stylesheet.css", 'r' ) ) - { - $css = fread($FH, filesize($this->work_path."/".$new_dir."/stylesheet.css") ); - fclose($FH); - - //------------------------- - // Swop Binary to Ascii - //------------------------- - - $css = preg_replace( "/\r/", "\n", stripslashes($css) ); - - $css_string = $DB->compile_db_update_string( array( - 'css_name' => stripslashes( $this->name_translated )." (Import)", - 'css_text' => $css, - ) ); - - $DB->query("UPDATE ibf_css SET $css_string WHERE cssid='{$next_id['css']}'"); - - - if ( $FHD = fopen( $INFO['base_dir']."style_sheets/stylesheet_".$next_id['css'].".css", 'w') ) - { - fwrite($FHD, $css, strlen($css) ); - fclose($FHD); - } - else - { - $this->import_error("Could not write new style sheet to 'style_sheets' directory, please check the permission and re-try", $next_id); - } - - } - else - { - $this->import_error("Could not read the uploaded CSS archive file, please check the permissions on that file and try again", $next_id); - } - - //------------------------------------------------------ - // Import the board wrapper - //------------------------------------------------------ - - if ($FH = fopen( $this->work_path."/".$new_dir."/wrapper.html", 'r' ) ) - { - $text = fread($FH, filesize($this->work_path."/".$new_dir."/wrapper.html") ); - fclose($FH); - - //------------------------- - // Swop Binary to Ascii - //------------------------- - - $text = preg_replace( "/\r/", "\n", stripslashes($text) ); - - $wrap_string = $DB->compile_db_update_string( array( - 'name' => stripslashes( $this->name_translated )." (Import)", - 'template' => $text, - ) ); - - $DB->query("UPDATE ibf_templates SET $wrap_string WHERE tmid='{$next_id['wrap']}'"); - - } - else - { - $this->import_error("Could not read the uploaded board wrapper archive file, please check the permissions on that file and try again", $next_id); - } - - //------------------------------------------------------ - // Attempt to copy over the image files - //------------------------------------------------------ - - if (! $ADMIN->copy_dir($this->work_path."/".$new_dir."/images", $images_dir."/".$next_id['images']) ) - { - $this->import_error("Could not import images, terminating the import", $next_id); - } - - //------------------------------------------------------ - // Fix up the images db table - //------------------------------------------------------ - - $new_array = array(); - - foreach($image_config as $k => $v) - { - if ( ($k == 'imid') or ($k == 'setname') ) - { - continue; - } - - $v = stripslashes($v); - - $v = preg_replace( "#/%img_dir%/#", "/".$next_id['images']."/", $v ); - - $new_array[ $k ] = $v; - } - - $db_string = $DB->compile_db_update_string( $new_array ); - - $DB->query("UPDATE ibf_images SET $db_string WHERE imid='{$next_id['images']}'"); - - unset($db_string); - - //------------------------------------------------------ - // Attempt to copy over the template files - //------------------------------------------------------ - - if (! $ADMIN->copy_dir($this->work_path."/".$new_dir."/templates", $templates_dir."/".$next_id['templates']) ) - { - $this->import_error("Could not import templates, terminating the import", $next_id); - } - - $tmpl_string = $DB->compile_db_update_string( $template_config ); - - $DB->query("UPDATE ibf_tmpl_names SET $tmpl_string WHERE skid='{$next_id['templates']}'"); - - //------------------------------------------------------ - // Add a new row to the skins table. - //------------------------------------------------------ - - $DB->query("SELECT MAX(sid) as new_id FROM ibf_skins"); - - $set = $DB->fetch_row(); - - $set['new_id']++; - - $new_name = stripslashes( $this->name_translated )." (Import)".$set['new_id']; - - $skin_string = $DB->compile_db_insert_string( array( 'sname' => $new_name, - 'sid' => $set['new_id'], - 'set_id' => $next_id['templates'], - 'tmpl_id' => $next_id['wrap'], - 'img_id' => $next_id['images'], - 'css_id' => $next_id['css'], - 'tbl_width' => $skin_set_config['tbl_width'], - 'tbl_border' => $skin_set_config['tbl_border'], - 'hidden' => 0, - 'default_set' => 0 - ) ); - - $DB->query("INSERT INTO ibf_skins (".$skin_string['FIELD_NAMES'].") VALUES(".$skin_string['FIELD_VALUES'].")"); - - //------------------------------------------------------ - // Resynchronise the PHP files wid' da' HTML templates - //------------------------------------------------------ - - $ADMIN->rm_dir($this->work_path."/".$new_dir); - - $templates_dir .= "/" .$next_id['templates']; - $skins_dir .= "/s".$next_id['templates']; - - $errors = array(); - - $errors = $this->rebuild_phpskin( $templates_dir, $skins_dir ); - - if ( is_array($errors) ) - { - if (count($errors > 0)) - { - $ADMIN->html .= $SKIN->start_table("Errors and warnings"); - - $ADMIN->html .= $SKIN->add_td_basic( implode("
    ", $errors) ); - - $ADMIN->html .= $SKIN->end_table(); - } - } - - $ADMIN->done_screen("Skin set Imported", "Manage Skin sets", "act=sets" ); - - } - - - //------------------------------------------------------------------- - - //------------------------------------------------------------------- - - function template_import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $templates_dir = $INFO['base_dir']."style_templates"; - - $skins_dir = $INFO['base_dir']."Skin"; - - if (! is_dir($templates_dir) ) - { - $ADMIN->error("Cannot write to the $images_dir directory, It is not there."); - } - - if (! is_writeable($templates_dir) ) - { - $ADMIN->error("Cannot write to the $images_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - if (! is_dir($skins_dir) ) - { - $ADMIN->error("Cannot write to the $skins_dir directory, It is not there."); - } - - if (! is_writeable($skins_dir) ) - { - $ADMIN->error("Cannot write to the $skins_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - //------------------------------------------------------ - - $this->tar->new_tar( $this->work_path, $this->tar_file ); - - $files = $this->tar->list_files(); - - if (! $this->check_archive($files) ) - { - $ADMIN->error("That is not a valid tar-achive, please re-upload in binary and try again"); - } - - //------------------------------------------------------ - // Add a dummy entry into the DB to get the next insert ID - //------------------------------------------------------ - - $DB->query("SELECT COUNT(*) as count FROM ibf_tmpl_names"); - - $count = $DB->fetch_row(); - - $DB->query("INSERT INTO ibf_tmpl_names SET skname=\"".$this->name_translated." (Import).{$count['count']}\""); - - $new_id = $DB->get_insert_id(); - - if ($new_id == "") - { - $ADMIN->error("Could not write to the database"); - } - - //------------------------------------------------------ - // Attempt a mkdir - //------------------------------------------------------ - - if (! mkdir($templates_dir."/".$new_id, 0777) ) - { - $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$new_id'"); - - $ADMIN->error("Could not create a new directory in style_templates"); - } - - @chmod($templates_dir."/".$new_id, 0777); - - //----------------------------------------------------- - - if (! mkdir($skins_dir."/s".$new_id, 0777) ) - { - $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$new_id'"); - - $ADMIN->error("Could not create a new directory in Skin"); - } - - @chmod($skins_dir."/s".$new_id, 0777); - - //------------------------------------------------------ - - $this->tar->extract_files($templates_dir."/".$new_id); - - if ($this->tar->error != "") - { - $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$new_id'"); - - $ADMIN->error( $this->tar->error ); - } - - //------------------------------------------------------ - // Make sure config file is present and correct and stuff - //------------------------------------------------------ - - if ( ! file_exists($templates_dir."/".$new_id."/config.php") ) - { - $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$new_id'"); - - $ADMIN->error( "Master template set configuration file 'config.php' is missing from this archive, terminating import" ); - } - - //------------------------------------------------------ - - if ( file_exists($templates_dir."/".$new_id."/conf.inc") ) - { - require $templates_dir."/".$new_id."/conf.inc"; - - $string = array( 'author' => stripslashes($config['author']), - 'email' => stripslashes($config['email']), - 'url' => stripslashes($config['url']), - ); - - $db_string = $DB->compile_db_update_string( $string ); - - $DB->query("UPDATE ibf_tmpl_names SET $db_string WHERE skid='$new_id'"); - } - - //------------------------------------------------------ - // Resynchronise the PHP files wid' da' HTML templates - - $templates_dir .= "/".$new_id; - $skins_dir .= "/s".$new_id; - - $errors = $this->rebuild_phpskin( $templates_dir, $skins_dir ); - - if (count($errors > 0)) - { - $ADMIN->html .= $SKIN->start_table("Errors and warnings"); - - $ADMIN->html .= $SKIN->add_td_basic( implode("
    ", $errors) ); - - $ADMIN->html .= $SKIN->end_table(); - } - - $ADMIN->done_screen("Template set Imported", "Manage Template sets", "act=templ" ); - - } - - - //------------------------------------------------------------------- - - function image_import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $images_dir = $INFO['base_dir']."style_images"; - - if (! is_dir($images_dir) ) - { - $ADMIN->error("Cannot write to the $images_dir directory, It is not there."); - } - - if (! is_writeable($images_dir) ) - { - $ADMIN->error("Cannot write to the $images_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - //------------------------------------------------------ - - $this->tar->new_tar( $this->work_path, $this->tar_file ); - - $files = $this->tar->list_files(); - - if (! $this->check_archive($files) ) - { - $ADMIN->error("That is not a valid tar-achive, please re-upload in binary and try again"); - } - - //------------------------------------------------------ - // Add a dummy entry into the DB to get the next insert ID - //------------------------------------------------------ - - $DB->query("INSERT INTO ibf_images SET setname=\"".$this->name_translated." (Import)\""); - - $new_id = $DB->get_insert_id(); - - if ($new_id == "") - { - $ADMIN->error("Could not write to the database"); - } - - //------------------------------------------------------ - // Attempt a mkdir - //------------------------------------------------------ - - if (! mkdir($images_dir."/".$new_id, 0777) ) - { - $DB->query("DELETE FROM ibf_images WHERE imid='$new_id'"); - - $ADMIN->error("Could not create a new directory in style_images"); - } - - @chmod($images_dir."/".$new_id, 0777); - - //------------------------------------------------------ - - $this->tar->extract_files($images_dir."/".$new_id); - - if ($this->tar->error != "") - { - $DB->query("DELETE FROM ibf_images WHERE imid='$new_id'"); - - $ADMIN->error( $this->tar->error ); - } - - //------------------------------------------------------ - - if ( ! file_exists($images_dir."/".$new_id."/conf.inc") ) - { - $DB->query("DELETE FROM ibf_images WHERE imid='$new_id'"); - - $ADMIN->error("Could not locate the configuration file!"); - } - - //------------------------------------------------------ - - require $images_dir."/".$new_id."/conf.inc"; - - $new_array = array(); - - foreach($config as $k => $v) - { - if ( ($k == 'imid') or ($k == 'setname') ) - { - continue; - } - - $v = stripslashes($v); - - $v = preg_replace( "#/%img_dir%/#", "/$new_id/", $v ); - - $new_array[ $k ] = $v; - } - - //------------------------------------------------------ - - // Update the DB - - $db_string = $DB->compile_db_update_string( $new_array ); - - $DB->query("UPDATE ibf_images SET $db_string WHERE imid='$new_id'"); - - @unlink($images_dir."/".$new_id."/conf.inc"); - - $ADMIN->done_screen("Image & Macro Imported", "Manage Image & Macro sets", "act=image" ); - - } - - //------------------------------------------------------------------- - - //------------------------------------------------------------------- - - function wrap_import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - // Attempt to open the template file... - - if ($FH = fopen( $this->tar_with_path, 'r' ) ) - { - $text = fread($FH, filesize($this->tar_with_path) ); - fclose($FH); - - //------------------------- - // Swop Binary to Ascii - //------------------------- - - $text = preg_replace( "/\r/", "\n", stripslashes($text) ); - - $string = $DB->compile_db_insert_string( array( - 'name' => stripslashes( $this->name_translated )." (Import)", - 'template' => $text, - ) ); - - $DB->query("INSERT INTO ibf_templates (".$string['FIELD_NAMES'].") VALUES(".$string['FIELD_VALUES'].")"); - - } - else - { - $ADMIN->error("Could not read the uploaded board wrapper archive file, please check the permissions on that file and try again"); - } - - $ADMIN->done_screen("Board Wrapper Imported", "Manage Board Wrappers", "act=wrap" ); - - } - - //------------------------------------------------------------------- - - - function css_import() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if (! is_dir($INFO['base_dir']."style_sheets") ) - { - $ADMIN->error("Cannot write to the {$INFO['base_dir']}style_sheets directory, It is not there."); - } - - if (! is_writeable($INFO['base_dir']."style_sheets") ) - { - $ADMIN->error("Cannot write to the {$INFO['base_dir']}style_sheets directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); - } - - - // Attempt to open the CSS file... - - if ($FH = fopen( $this->tar_with_path, 'r' ) ) - { - $css = fread($FH, filesize($this->tar_with_path) ); - fclose($FH); - - //------------------------- - // Swop Binary to Ascii - //------------------------- - - $css = preg_replace( "/\r/", "\n", stripslashes($css) ); - - $string = $DB->compile_db_insert_string( array( - 'css_name' => stripslashes( $this->name_translated )." (Import)", - 'css_text' => $css, - ) ); - - $DB->query("INSERT INTO ibf_css (".$string['FIELD_NAMES'].") VALUES(".$string['FIELD_VALUES'].")"); - - if ( $new_id = $DB->get_insert_id() ) - { - if ( $FHD = fopen( $INFO['base_dir']."style_sheets/stylesheet_".$new_id.".css", 'w') ) - { - fwrite($FHD, $css, strlen($css) ); - fclose($FHD); - } - else - { - $DB->query("DELETE FROM ibf_css WHERE cssid='$new_id'"); - $ADMIN->error("Could not write new style sheet to 'style_sheets' directory, please check the permission and re-try"); - } - } - else - { - $ADMIN->error("Could not write to the database."); - } - } - else - { - $ADMIN->error("Could not read the uploaded CSS archive file, please check the permissions on that file and try again"); - } - - $ADMIN->done_screen("CSS information Imported", "Manage Uploaded Archives", "act=import" ); - - } - - - - - //---------------------------------------------------- - - function check_archive($files) - { - if (count($files) > 0) - { - foreach($files as $giles) - { - if ( ! preg_match( "/^(?:[\(\)\:\;\~\.\w\d\+\-\_\/]+)$/", $giles) ) - { - return FALSE; - } - } - } - else - { - return FALSE; - } - - return TRUE; - } - - - //------------------------------------------------------------- - // SHOW ALL LANGUAGE PACKS - //------------------------------------------------------------- - - function list_current() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - - $ADMIN->page_detail = "You can select which archives to import onto your board in this section. All archives must be uploaded into the 'archive_in' directory"; - $ADMIN->page_title = "Import Skin Archive Manager"; - - - - //+------------------------------- - - $files = array(); - - $dir = $INFO['base_dir']."/archive_in"; - - if ( is_dir($dir) ) - { - $handle = opendir($dir); - - while (($filename = readdir($handle)) !== false) - { - if (($filename != ".") && ($filename != "..")) - { - if (preg_match("/^(css|image|set|wrap|tmpl).+?\.(tar|html|css)$/", $filename)) - { - $files[] = $filename; - } - } - } - - closedir($handle); - - } - - //+------------------------------- - - $SKIN->td_header[] = array( "Name" , "30%" ); - $SKIN->td_header[] = array( "Type" , "20%" ); - $SKIN->td_header[] = array( "File Name" , "30%" ); - $SKIN->td_header[] = array( "Import" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Current Archives Uploaded" ); - - if ( count($files) > 0 ) - { - foreach($files as $file) - { - - $type = array( 'css' => 'Style Sheet', - 'image' => 'Image & Macro set', - 'set' => 'Skin Set Collection', - 'wrap' => 'Board Wrapper', - 'tmpl' => 'Template set' - ); - - $rtype = preg_replace( "/^(css|image|set|wrap|tmpl).+?\.(\S+)$/" , "\\1", $file ); - - $rname = preg_replace( "/^(css|image|set|wrap|tmpl)-(.+?)\.(\S+)$/", "\\2", $file ); - - $rname = preg_replace( "/_/", " ", $rname ); - - - $ADMIN->html .= $SKIN->add_td_row( array( "$rname", - "
    {$type[$rtype]}
    ", - "
    $file
    ", - "
    Import
    ", - "
    Remove
    ", - ) ); - } - - } - - $ADMIN->html .= $SKIN->end_table(); - - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - function unconvert_tags($t="") - { - if ($t == "") - { - return ""; - } - - $t = preg_replace( "/{ibf\.script_url}/i" , '{$ibforums->base_url}' , $t); - $t = preg_replace( "/{ibf\.session_id}/i" , '{$ibforums->session_id}' , $t); - $t = preg_replace( "/{ibf\.skin\.(\w+)}/" , '{$ibforums->skin[\''."\\1".'\']}' , $t); - $t = preg_replace( "/{ibf\.lang\.(\w+)}/" , '{$ibforums->lang[\''."\\1".'\']}' , $t); - $t = preg_replace( "/{ibf\.vars\.(\w+)}/" , '{$ibforums->vars[\''."\\1".'\']}' , $t); - $t = preg_replace( "/{ibf\.member\.(\w+)}/" , '{$ibforums->member[\''."\\1".'\']}' , $t); - - return $t; - - } - - function rebuild_phpskin($templates_dir, $skins_dir) - { - - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $errors = array(); - - require $templates_dir."/config.php"; - - if ( $handle = opendir($templates_dir) ) - { - - while (($filename = readdir($handle)) !== false) - { - if (($filename != ".") && ($filename != "..")) - { - if ( preg_match( "/^index\./", $filename ) ) - { - continue; - } - - //------------------------------------------- - - if ( preg_match( "/\.html$/", $filename ) ) - { - - $name = preg_replace( "/\.html$/", "", $filename ); - - - if ($FHD = fopen($templates_dir."/".$filename, 'r') ) - { - $text = fread($FHD, filesize($templates_dir."/".$filename) ); - fclose($FHD); - } - else - { - $errors[] = "Could not open $filename, skipping file..."; - continue; - } - - //---------------------------------------------------- - - $need = count($skin[$name]); - $start = 0; - $end = 0; - - if ($need < 1) - { - $errors[] = "Error recalling function data for $filename, skipping..."; - continue; - } - - // check to make sure the splitter tags are intact - - foreach($skin[$name] as $func_name => $data) - { - if ( preg_match("//", $text) ) - { - $start++; - } - - //+------------------------------- - - if ( preg_match("//", $text) ) - { - $end++; - } - } - - if ($start != $end) - { - $errors[] = "Some start or end template splitter comments are missing in $filename, skipping file...."; - continue; - } - - if ($start != $need) - { - $errors[] = "Some template splitter comments are missing in $filename, skipping file..."; - continue; - } - - //+------------------------------- - // Convert the tags back to php native - //+------------------------------- - - $text = $this->unconvert_tags($text); - - //+------------------------------- - // Start parsing the php skin file - //+------------------------------- - - $final = "<"."?php\n\n". - "class $name {\n\n"; - - foreach($skin[$name] as $func_name => $data) - { - - $top = "\n\nfunction $func_name($data) {\n". - "global \$ibforums;\n". - "return <<\s*\n/", "$top", $text); - - - //+------------------------------- - - $text = preg_replace("/\s*\s*\n/", "$bum", $text); - } - - $end = "\n\n}\n?".">"; - - $final .= $text.$end; - - if ($fh = fopen( $skins_dir."/".$name.".php", 'w' ) ) - { - fwrite($fh, $final, strlen($final) ); - fclose($fh); - @chmod( $skins_dir."/".$name.".php", 0777 ); - } - else - { - $errors[] = "Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."; - } - - $end = ""; - $final = ""; - $top = ""; - - } // if *.php - - } // if not dir - - } // while loop - - closedir($handle); - - } - else - { - $errors[] = "Could not open the templates directory!"; - } - - return $errors; - - } - - - function import_error( $error, $next_id) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $DB->query("DELETE FROM ibf_images WHERE imid='{$next_id['images']}'"); - $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='{$next_id['templates']}'"); - $DB->query("DELETE FROM ibf_css WHERE cssid='{$next_id['css']}'"); - $DB->query("DELETE FROM ibf_templates WHERE tmid='{$next_id['wrap']}'"); - - @rmdir($INFO['base_dir']."/style_images/".$next_id['images']); - @rmdir($INFO['base_dir']."/style_templates/".$next_id['templates']); - @rmdir($INFO['base_dir']."/Skin/s".$next_id['templates']); - - $ADMIN->rm_dir($this->work_path."/".$this->new_dir); - - $ADMIN->error( $error ); - - } - - -} - - + Import functions +| > Module written by Matt Mecham +| > Date started: 22nd April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + +$idx = new ad_langs(); + + +class ad_langs { + + var $base_url; + + function ad_langs() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + + case 'doimport': + $this->doimport(); + break; + + case 'import': + $this->import(); + break; + + case 'remove': + $this->remove(); + break; + + + //------------------------- + default: + $this->list_current(); + break; + } + + } + + + //--------------------------------------------- + // Remove archived files + //--------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You did not select a tar-chive to import!"); + } + + $this->tar_with_path = $INFO['base_dir']."archive_in/".$IN['id']; + + if ( ! unlink($this->tar_with_path) ) + { + $ADMIN->error("Could not remove that file, please check the CHMOD permissions"); + } + + $std->boink_it($ADMIN->base_url."&act=import"); + exit(); + + + } + + + //--------------------------------------------- + // Import switcheroo + //--------------------------------------------- + + function import() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You did not select a tar-chive to import!"); + } + + $this->tar_with_path = $INFO['base_dir']."archive_in/".$IN['id']; + + $this->work_path = $INFO['base_dir']."archive_in"; + + if (! file_exists($this->tar_with_path) ) + { + $ADMIN->error( "That archive is not found on the server, it may have been deleted by another admin"); + } + + $this->tar_file = $IN['id']; + + $this->name_translated = preg_replace( "/^(css|image|set|wrap|tmpl)-(.+?)\.(\S+)$/", "\\2", $this->tar_file ); + $this->name_translated = preg_replace( "/_/", " ", $this->name_translated ); + + require $root_dir."sources/lib/tar.php"; + + $this->tar = new tar(); + + switch($IN['type']) + { + case 'css': + $this->css_import(); + break; + + case 'wrap': + $this->wrap_import(); + break; + + case 'image': + $this->image_import(); + break; + + case 'tmpl': + $this->template_import(); + break; + case 'set': + $this->set_import(); + break; + + //--------- + default: + $ADMIN->error("Unrecognised archive type"); + break; + } + + + } + + function set_import() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $images_dir = $INFO['base_dir']."style_images"; + $skins_dir = $INFO['base_dir']."Skin"; + + if (! is_writeable($images_dir) ) + { + $ADMIN->error("Cannot write to the $images_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); + } + + if (! is_dir($skins_dir) ) + { + $ADMIN->error("Cannot write to the $skins_dir directory, It is not there."); + } + + if (! is_writeable($skins_dir) ) + { + $ADMIN->error("Cannot write to the $skins_dir directory, please set sufficient CHMOD permissions to allow this. IBF cannot do this for you."); + } + + //------------------------------------------------------ + + $this->tar->new_tar( $this->work_path, $this->tar_file ); + + $files = $this->tar->list_files(); + + if (! $this->check_archive($files) ) + { + $ADMIN->error("That is not a valid tar-achive, please re-upload in binary and try again"); + } + + //------------------------------------------------------ + + $DB->query("SELECT COUNT(*) as count FROM ibf_tmpl_names"); + + $tmpl_count = $DB->fetch_row(); + + //------------------------------------------------------ + // Attempt to create a new work directory + //------------------------------------------------------ + + $new_dir = preg_replace( "/^(.+?)\.tar$/", "\\1", $this->tar_file ); + + $this->new_dir = $new_dir; + + if ( ! mkdir($this->work_path."/".$new_dir, 0777) ) + { + $ADMIN->error("Directory creation failed, cannot import skin set. Please check the permission in 'archive_in'"); + } + + @chmod($this->work_path."/".$new_dir, 0777); + + $next_id = array( 'css' => 0, 'wrap' => 0, 'templates' => 0, 'macro' => 0 ); + + //------------------------------------------------------ + // Add a dummy entries into the DB to get the next insert ID + //------------------------------------------------------ + + $DB->query("INSERT INTO ibf_tmpl_names SET skname=\"".$this->name_translated." (Set Import).{$tmpl_count['count']}\""); + + $next_id['templates'] = $DB->get_insert_id(); + + //------------------------------------------------------ + + $DB->query("INSERT INTO ibf_css SET css_name=\"".$this->name_translated." (Set Import)\""); + + $next_id['css'] = $DB->get_insert_id(); + + //------------------------------------------------------ + + $DB->query("INSERT INTO ibf_templates SET name=\"".$this->name_translated." (Set Import)\""); + + $next_id['wrap'] = $DB->get_insert_id(); + + //------------------------------------------------------ + // Get the new macro set_id + //------------------------------------------------------ + + $DB->query("SELECT MAX(set_id) as max FROM ibf_macro_name"); + + $max = $DB->fetch_row(); + + $next_id['macro'] = $max['max'] + 1; + + //------------------------------------------------------ + // Attempt to create the new directories + //------------------------------------------------------ + + $next_id['images'] = str_replace( " ", "_", substr($this->name_translated,0,8) ) . '-'. substr( time(), 7,10); + + if (! mkdir($images_dir."/".$next_id['images'], 0777) ) + { + $this->import_error("Could not create a new directory in style_images", $next_id); + } + + @chmod($images_dir."/".$next_id['images'], 0777); + + //----------------------------------------------------- + + if (! mkdir($skins_dir."/s".$next_id['templates'], 0777) ) + { + $this->import_error("Could not create a new directory in Skin", $next_id); + } + + @chmod($skins_dir."/s".$next_id['templates'], 0777); + + //------------------------------------------------------ + + $this->tar->extract_files($this->work_path."/".$new_dir); + + if ($this->tar->error != "") + { + $this->import_error($this->tar->error, $next_id); + } + + //------------------------------------------------------ + + if ( file_exists($this->work_path."/".$new_dir."/templates_conf.inc") ) + { + require $this->work_path."/".$new_dir."/templates_conf.inc"; + + $template_config = array( 'author' => stripslashes($config['author']), + 'email' => stripslashes($config['email']), + 'url' => stripslashes($config['url']), + ); + + $db_string = $DB->compile_db_update_string( $template_config ); + + $DB->query("UPDATE ibf_tmpl_names SET $db_string WHERE skid='{$next_id['templates']}'"); + } + + //------------------------------------------------------ + // Import the CSS + //------------------------------------------------------ + + if ($FH = fopen( $this->work_path."/".$new_dir."/stylesheet.css", 'r' ) ) + { + $css = fread($FH, filesize($this->work_path."/".$new_dir."/stylesheet.css") ); + fclose($FH); + + //------------------------- + // Swop Binary to Ascii + //------------------------- + + $css = preg_replace( "/\r/", "\n", stripslashes($css) ); + + $css_string = $DB->compile_db_update_string( array( + 'css_name' => stripslashes( $this->name_translated )." (Import)", + 'css_text' => $css, + ) ); + + $DB->query("UPDATE ibf_css SET $css_string WHERE cssid='{$next_id['css']}'"); + + } + else + { + $this->import_error("Could not read the uploaded CSS archive file, please check the permissions on that file and try again", $next_id); + } + + //------------------------------------------------------ + // Import the board wrapper + //------------------------------------------------------ + + if ($FH = fopen( $this->work_path."/".$new_dir."/wrapper.html", 'r' ) ) + { + $text = fread($FH, filesize($this->work_path."/".$new_dir."/wrapper.html") ); + fclose($FH); + + //------------------------- + // Swop Binary to Ascii + //------------------------- + + $text = preg_replace( "/\r/", "\n", stripslashes($text) ); + + $wrap_string = $DB->compile_db_update_string( array( + 'name' => stripslashes( $this->name_translated )." (Import)", + 'template' => $text, + ) ); + + $DB->query("UPDATE ibf_templates SET $wrap_string WHERE tmid='{$next_id['wrap']}'"); + + } + else + { + $this->import_error("Could not read the uploaded board wrapper archive file, please check the permissions on that file and try again", $next_id); + } + + //------------------------------------------------------ + // Attempt to copy over the image files + //------------------------------------------------------ + + if (! $ADMIN->copy_dir($this->work_path."/".$new_dir."/images", $images_dir."/".$next_id['images']) ) + { + $this->import_error("Could not import images, terminating the import", $next_id); + } + + //------------------------------------------------------ + // Import the Macro's + //------------------------------------------------------ + + if ($FH = fopen( $this->work_path."/".$new_dir."/macro.txt", 'r' ) ) + { + $data = fread($FH, filesize($this->work_path."/".$new_dir."/macro.txt") ); + fclose($FH); + + $init_array = array(); + $final_keys = array(); + + $init_array = explode("\n", $data); + + foreach( $init_array as $l ) + { + if (preg_match( "~=~", $l ) ) + { + // is valid line + + list($k, $v) = explode( "~=~", $l ); + + $k = trim($k); + $v = trim($v); + + $final_keys[$k] = $v; + } + } + + foreach( $final_keys as $k => $v) + { + if ($v == '*UNASSIGNED*') + { + $v = ""; + } + + $str = $DB->compile_db_insert_string( array ( + 'macro_value' => stripslashes($k), + 'macro_replace' => stripslashes($v), + 'macro_set' => $next_id['macro'], + 'can_remove' => 1, + ) ); + + $DB->query("INSERT INTO ibf_macro ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + } + + // Add the macro name + + $DB->query("INSERT INTO ibf_macro_name SET set_id='".$next_id['macro']."', set_name='".$this->name_translated."'"); + + } + else + { + $this->import_error("Could not read the macro.txt file contained in the skin you're importing.", $next_id); + } + + $tmpl_string = $DB->compile_db_update_string( $template_config ); + + $DB->query("UPDATE ibf_tmpl_names SET $tmpl_string WHERE skid='{$next_id['templates']}'"); + + //------------------------------------------------------ + // Import the TEMPLATES - wohoo, this'll make the server burn + //------------------------------------------------------ + + if ($FH = fopen( $this->work_path."/".$new_dir."/templates.html", 'r' ) ) + { + $data = fread($FH, filesize($this->work_path."/".$new_dir."/templates.html") ); + fclose($FH); + + //------------------------------------------------- + // Divide the file up into different sections + //------------------------------------------------- + + preg_match_all( "/(.+?)/s", $data, $match ); + + for ($i=0; $i < count($match[0]); $i++) + { + $match[1][$i] = trim($match[1][$i]); + + $match[2][$i] = trim($match[2][$i]); + + // Pass it on to our handler.. + + $this->process_template_group($match[2][$i], $next_id['templates'], $match[1][$i], 1 ); + } + } + else + { + $this->import_error("Could not read the templates.html file contained in the skin you're importing.", $next_id); + } + + //------------------------------------------------------ + // Add a new row to the skins table. + //------------------------------------------------------ + + $DB->query("SELECT MAX(sid) as new_id FROM ibf_skins"); + + $set = $DB->fetch_row(); + + $set['new_id']++; + + $new_name = stripslashes( $this->name_translated )." (Import)".$set['new_id']; + + $skin_string = $DB->compile_db_insert_string( array( 'sname' => $new_name, + 'sid' => $set['new_id'], + 'set_id' => $next_id['templates'], + 'tmpl_id' => $next_id['wrap'], + 'img_dir' => $next_id['images'], + 'css_id' => $next_id['css'], + 'macro_id' => $next_id['macro'], + 'hidden' => 0, + 'default_set' => 0 + ) ); + + $DB->query("INSERT INTO ibf_skins (".$skin_string['FIELD_NAMES'].") VALUES(".$skin_string['FIELD_VALUES'].")"); + + $ADMIN->rm_dir($this->work_path."/".$new_dir); + + $ADMIN->done_screen("Skin set Imported", "Manage Skin sets", "act=sets" ); + + } + + + //------------------------------------------------------ + //process the template group + //------------------------------------------------------ + + + function process_template_group($raw, $setid, $group, $isnew=0) + { + global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $root_path = $INFO['base_dir']; + + $skin_dir = $root_path."Skin/s".$setid; + + //------------------------------------------- + // If we are not using safe mode skins, lets + // test to make sure we can write to that dir + //------------------------------------------- + + if ($INFO['safe_mode_skins'] != 1) + { + + if (SAFE_MODE_ON == 1) + { + if ($isnew == 1) + { + $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$setid'"); + } + $ADMIN->error("Safe mode detected, you will need to change the board configuration to switch 'Safe Mode Skins' on. To do this, click on the 'Board Settings' menu and choose 'Basic Config' when the sub menu appears."); + } + + // Are we creating a new template set? + // if so, lets create the directory + + if ($isnew == 1) + { + if ( ! is_writeable($root_path.'Skin') ) + { + $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$setid'"); + $ADMIN->error("The directory 'Skin' is not writeable by this script. Please check the permissions on that directory. CHMOD to 0777 if in doubt and try again"); + } + + /*if ( ! file_exists($skin_dir) ) + { + // Directory does not exist, lets create it + + if ( ! @mkdir($skin_dir, 0777) ) + { + $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$setid'"); + $ADMIN->error("Could not create directory '$skin_dir' please check the CHMOD permissions and re-try"); + } + else + { + @chmod($skin_dir, 0777); + } + }*/ + } + else + { + if ( ! is_writeable($skin_dir) ) + { + $ADMIN->error("Cannot write into '$skin_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + } + + } + + //-------------------------------- + // Remove everything up until the + // first \s*/", $line, $matches) ) + { + $func = trim($matches[1]); + $data = trim($matches[2]); + + if ($func != "") + { + + $flag = $func; + + $master[$func] = array( 'func_name' => $func, + 'func_data' => $data, + 'content' => "" + ); + } + continue; + + } + + } + + if ( preg_match("/\s*?\s*?/", $line) ) + { + // We have found the end of the subbie.. + // Reset the flag and feed the next line. + + $flag = 0; + continue; + } + else + { + // Carry on feeding the HTML... + + if ( isset($master[$flag]['content']) ) + { + $master[$flag]['content'] .= $line."\n"; + continue; + } + } + + } + + //+------------------------------- + // Start parsing the php skin file + //+------------------------------- + + if ($INFO['safe_mode_skins'] != 1) + { + + if (SAFE_MODE_ON == 1) + { + $ADMIN->error("Safe mode detected, you will need to change the board configuration to switch 'Safe Mode Skins' on. To do this, click on the 'Board Settings' menu and choose 'Basic Config' when the sub menu appears."); + } + + $final = "<"."?php\n\n". + "class $group {\n\n"; + + foreach( $master as $func_name => $data ) + { + + $final .= "\n\nfunction ".trim($data['func_name'])."(".trim($data['func_data']).") {\n". + "global \$ibforums;\n". + "return <<"; + + if ($fh = fopen( $skin_dir."/".$group.".php", 'w' ) ) + { + fwrite($fh, $final, strlen($final) ); + fclose($fh); + + @chmod( $skin_dir."/".$group.".php", 0777 ); + } + else + { + if ($isnew == 1) + { + $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='$setid'"); + } + $errors[] = "Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."; + } + + } + + //+------------------------------- + // Update the DB + //+------------------------------- + + + foreach( $master as $func_name => $data ) + { + + if ($isnew == 0) + { + $str = $DB->compile_db_update_string( array( + 'section_content' => stripslashes(trim($data['content'])), + 'func_data' => stripslashes(trim($data['func_data'])) + ) ); + + $DB->query("UPDATE ibf_skin_templates SET $str WHERE set_id='$setid' AND group_name='$group' AND func_name='".trim($data['func_name'])."'"); + } + else + { + $str = $DB->compile_db_insert_string( array( + 'section_content' => stripslashes(trim($data['content'])), + 'func_data' => stripslashes(trim($data['func_data'])), + 'set_id' => $setid, + 'group_name' => $group, + 'func_name' => trim($data['func_name']), + 'can_remove' => 0, + ) ); + + $DB->query("INSERT INTO ibf_skin_templates ({$str['FIELD_NAMES']}) VALUES({$str['FIELD_VALUES']})"); + } + } + + + return TRUE; + + + } + + + + //------------------------------------------------------------------- + + //------------------------------------------------------------------- + + function template_import() + { + // Depreciated + + } + + + //------------------------------------------------------------------- + + function image_import() + { + // Depreciated + + } + + //------------------------------------------------------------------- + + //------------------------------------------------------------------- + + function wrap_import() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + // Depreciated + + } + + //------------------------------------------------------------------- + + + function css_import() + { + // Depreciated + + } + + + + + //---------------------------------------------------- + + function check_archive($files) + { + if (count($files) > 0) + { + foreach($files as $giles) + { + if ( ! preg_match( "/^(?:[\(\)\:\;\~\.\w\d\+\-\_\/]+)$/", $giles) ) + { + return FALSE; + } + } + } + else + { + return FALSE; + } + + return TRUE; + } + + + //------------------------------------------------------------- + // SHOW ALL LANGUAGE PACKS + //------------------------------------------------------------- + + function list_current() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + + $ADMIN->page_detail = "You can select which archives to import onto your board in this section. All archives must be uploaded into the 'archive_in' directory"; + $ADMIN->page_title = "Import Skin Archive Manager"; + + + + //+------------------------------- + + $files = array(); + + $dir = $INFO['base_dir']."/archive_in"; + + if ( is_dir($dir) ) + { + $handle = opendir($dir); + + while (($filename = readdir($handle)) !== false) + { + if (($filename != ".") && ($filename != "..")) + { + if (preg_match("/^(css|image|set|wrap|tmpl).+?\.(tar|html|css)$/", $filename)) + { + $files[] = $filename; + } + } + } + + closedir($handle); + + } + + //+------------------------------- + + $SKIN->td_header[] = array( "Name" , "30%" ); + $SKIN->td_header[] = array( "Type" , "20%" ); + $SKIN->td_header[] = array( "File Name" , "30%" ); + $SKIN->td_header[] = array( "Import" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Current Archives Uploaded" ); + + if ( count($files) > 0 ) + { + foreach($files as $file) + { + + $type = array( 'css' => 'Style Sheet', + 'image' => 'Image & Macro set', + 'set' => 'Skin Set Collection', + 'wrap' => 'Board Wrapper', + 'tmpl' => 'Template set' + ); + + $rtype = preg_replace( "/^(css|image|set|wrap|tmpl).+?\.(\S+)$/" , "\\1", $file ); + + $rname = preg_replace( "/^(css|image|set|wrap|tmpl)-(.+?)\.(\S+)$/", "\\2", $file ); + + $rname = preg_replace( "/_/", " ", $rname ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "$rname", + "
    {$type[$rtype]}
    ", + "
    $file
    ", + "
    Import
    ", + "
    Remove
    ", + ) ); + } + + } + + $ADMIN->html .= $SKIN->end_table(); + + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + function unconvert_tags($t="") + { + if ($t == "") + { + return ""; + } + + $t = preg_replace( "/{ibf\.script_url}/i" , '{$ibforums->base_url}' , $t); + $t = preg_replace( "/{ibf\.session_id}/i" , '{$ibforums->session_id}' , $t); + $t = preg_replace( "/{ibf\.skin\.(\w+)}/" , '{$ibforums->skin[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.lang\.(\w+)}/" , '{$ibforums->lang[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.vars\.(\w+)}/" , '{$ibforums->vars[\''."\\1".'\']}' , $t); + $t = preg_replace( "/{ibf\.member\.(\w+)}/" , '{$ibforums->member[\''."\\1".'\']}' , $t); + + return $t; + + } + + function rebuild_phpskin($templates_dir, $skins_dir) + { + + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $errors = array(); + + require $templates_dir."/config.php"; + + if ( $handle = opendir($templates_dir) ) + { + + while (($filename = readdir($handle)) !== false) + { + if (($filename != ".") && ($filename != "..")) + { + if ( preg_match( "/^index\./", $filename ) ) + { + continue; + } + + //------------------------------------------- + + if ( preg_match( "/\.html$/", $filename ) ) + { + + $name = preg_replace( "/\.html$/", "", $filename ); + + + if ($FHD = fopen($templates_dir."/".$filename, 'r') ) + { + $text = fread($FHD, filesize($templates_dir."/".$filename) ); + fclose($FHD); + } + else + { + $errors[] = "Could not open $filename, skipping file..."; + continue; + } + + //---------------------------------------------------- + + $need = count($skin[$name]); + $start = 0; + $end = 0; + + if ($need < 1) + { + $errors[] = "Error recalling function data for $filename, skipping..."; + continue; + } + + // check to make sure the splitter tags are intact + + foreach($skin[$name] as $func_name => $data) + { + if ( preg_match("//", $text) ) + { + $start++; + } + + //+------------------------------- + + if ( preg_match("//", $text) ) + { + $end++; + } + } + + if ($start != $end) + { + $errors[] = "Some start or end template splitter comments are missing in $filename, skipping file...."; + continue; + } + + if ($start != $need) + { + $errors[] = "Some template splitter comments are missing in $filename, skipping file..."; + continue; + } + + //+------------------------------- + // Convert the tags back to php native + //+------------------------------- + + $text = $this->unconvert_tags($text); + + //+------------------------------- + // Start parsing the php skin file + //+------------------------------- + + $final = "<"."?php\n\n". + "class $name {\n\n"; + + foreach($skin[$name] as $func_name => $data) + { + + $top = "\n\nfunction $func_name($data) {\n". + "global \$ibforums;\n". + "return <<\s*\n/", "$top", $text); + + + //+------------------------------- + + $text = preg_replace("/\s*\s*\n/", "$bum", $text); + } + + $end = "\n\n}\n?".">"; + + $final .= $text.$end; + + if ($fh = fopen( $skins_dir."/".$name.".php", 'w' ) ) + { + fwrite($fh, $final, strlen($final) ); + fclose($fh); + @chmod( $skins_dir."/".$name.".php", 0777 ); + } + else + { + $errors[] = "Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."; + } + + $end = ""; + $final = ""; + $top = ""; + + } // if *.php + + } // if not dir + + } // while loop + + closedir($handle); + + } + else + { + $errors[] = "Could not open the templates directory!"; + } + + return $errors; + + } + + + function import_error( $error, $next_id) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $DB->query("DELETE FROM ibf_macro_name WHERE set_id='{$next_id['macro']}'"); + $DB->query("DELETE FROM ibf_macro WHERE macro_id='{$next_id['macro']}'"); + $DB->query("DELETE FROM ibf_tmpl_names WHERE skid='{$next_id['templates']}'"); + $DB->query("DELETE FROM ibf_css WHERE cssid='{$next_id['css']}'"); + $DB->query("DELETE FROM ibf_templates WHERE tmid='{$next_id['wrap']}'"); + $DB->query("DELETE FROM ibf_skin_templates WHERE set_id='{$next_id['templates']}'"); + + @rmdir($INFO['base_dir']."/style_images/".$next_id['images']); + @rmdir($INFO['base_dir']."/Skin/s".$next_id['templates']); + + $ADMIN->rm_dir($this->work_path."/".$this->new_dir); + + $ADMIN->error( $error ); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_statistics.php b/upload/sources/Admin/ad_statistics.php new file mode 100644 index 00000000..05715141 --- /dev/null +++ b/upload/sources/Admin/ad_statistics.php @@ -0,0 +1,533 @@ + Statistical functions +| > Module written by Matt Mecham +| > Date started: 4th July 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + + +$idx = new ad_stats(); + + +class ad_stats { + + var $base_url; + var $month_names = array(); + + function ad_stats() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $this->month_names = array( 1 => 'January', 'February', 'March' , 'April' , 'May' , 'June', + 'July' , 'August' , 'September' , 'October', 'November', 'December' + ); + + switch($IN['code']) + { + case 'show_reg': + $this->result_screen('reg'); + break; + + case 'show_topic': + $this->result_screen('topic'); + break; + + case 'topic': + $this->main_screen('topic'); + break; + + //----------------------- + + case 'show_post': + $this->result_screen('post'); + break; + + case 'post': + $this->main_screen('post'); + break; + + //----------------------- + + case 'show_msg': + $this->result_screen('msg'); + break; + + case 'msg': + $this->main_screen('msg'); + break; + + //----------------------- + + case 'show_views': + $this->show_views(); + break; + + case 'views': + $this->main_screen('views'); + break; + + //----------------------- + + default: + $this->main_screen('reg'); + break; + } + + } + + //select forum_id, SUM(views)from ibf_topics group by forum_id order by forum_id + + //+--------------------------------------------------------------------------------- + //| Results screen + //+--------------------------------------------------------------------------------- + + function show_views() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Statistic Center Results"; + + $ADMIN->page_detail = "Showing topic view statistics"; + + //+--------------------- + + if ( ! checkdate($IN['to_month'] ,$IN['to_day'] ,$IN['to_year']) ) + { + $ADMIN->error("The 'Date To:' time is incorrect, please check the input and try again"); + } + + if ( ! checkdate($IN['from_month'] ,$IN['from_day'] ,$IN['from_year']) ) + { + $ADMIN->error("The 'Date From:' time is incorrect, please check the input and try again"); + } + + //+--------------------- + + $to_time = mktime(12 ,0 ,0 ,$IN['to_month'] ,$IN['to_day'] ,$IN['to_year'] ); + $from_time = mktime(12 ,0 ,0 ,$IN['from_month'] ,$IN['from_day'] ,$IN['from_year']); + + + $human_to_date = getdate($to_time); + $human_from_date = getdate($from_time); + + $DB->query("SELECT SUM(t.views) as result_count, t.forum_id, f.name as result_name + FROM ibf_topics t, ibf_forums f + WHERE t.start_date > '$from_time' + AND t.start_date < '$to_time' + AND t.forum_id=f.id + GROUP BY t.forum_id + ORDER BY result_count {$IN['sortby']}"); + + $running_total = 0; + $max_result = 0; + + $results = array(); + + $SKIN->td_header[] = array( "Forum" , "40%" ); + $SKIN->td_header[] = array( "Result" , "50%" ); + $SKIN->td_header[] = array( "Views" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Topic Views" + ." ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} to" + ." {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})" + ); + + if ( $DB->get_num_rows() ) + { + + while ($row = $DB->fetch_row() ) + { + + if ( $row['result_count'] > $max_result ) + { + $max_result = $row['result_count']; + } + + $running_total += $row['result_count']; + + $results[] = array( + 'result_name' => $row['result_name'], + 'result_count' => $row['result_count'], + ); + + } + + foreach( $results as $pOOp => $data ) + { + + $img_width = intval( ($data['result_count'] / $max_result) * 100 - 8) . "%"; + + $ADMIN->html .= $SKIN->add_td_row( array( $data['result_name'], + "", + "
    ".$data['result_count']."
    ", + ) ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( ' ', + "
    Total
    ", + "
    ".$running_total."
    ", + ) ); + + } + else + { + $ADMIN->html .= $SKIN->add_td_basic( "No results found", "center" ); + } + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //+--------------------------------------------------------------------------------- + //| Results screen + //+--------------------------------------------------------------------------------- + + function result_screen($mode='reg') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Statistic Center Results"; + + $ADMIN->page_detail = " "; + + //+--------------------- + + if ( ! checkdate($IN['to_month'] ,$IN['to_day'] ,$IN['to_year']) ) + { + $ADMIN->error("The 'Date To:' time is incorrect, please check the input and try again"); + } + + if ( ! checkdate($IN['from_month'] ,$IN['from_day'] ,$IN['from_year']) ) + { + $ADMIN->error("The 'Date From:' time is incorrect, please check the input and try again"); + } + + //+--------------------- + + $to_time = mktime(12 ,0 ,0 ,$IN['to_month'] ,$IN['to_day'] ,$IN['to_year'] ); + $from_time = mktime(12 ,0 ,0 ,$IN['from_month'] ,$IN['from_day'] ,$IN['from_year']); + + + $human_to_date = getdate($to_time); + $human_from_date = getdate($from_time); + + //+--------------------- + + if ($mode == 'reg') + { + $table = 'Registration Statistics'; + + $sql_table = 'ibf_members'; + $sql_field = 'joined'; + + $ADMIN->page_detail = "Showing the number of users registered. (Note: All times based on GMT)"; + } + else if ($mode == 'topic') + { + $table = 'New Topic Statistics'; + + $sql_table = 'ibf_topics'; + $sql_field = 'start_date'; + + $ADMIN->page_detail = "Showing the number of topics started. (Note: All times based on GMT)"; + } + else if ($mode == 'post') + { + $table = 'Post Statistics'; + + $sql_table = 'ibf_posts'; + $sql_field = 'post_date'; + + $ADMIN->page_detail = "Showing the number of posts. (Note: All times based on GMT)"; + } + else if ($mode == 'msg') + { + $table = 'PM Sent Statistics'; + + $sql_table = 'ibf_messages'; + $sql_field = 'msg_date'; + + $ADMIN->page_detail = "Showing the number of sent messages. (Note: All times based on GMT)"; + } + + + switch ($IN['timescale']) + { + case 'daily': + $sql_date = "%w %U %m %Y"; + $php_date = "F jS - Y"; + break; + + case 'monthly': + $sql_date = "%m %Y"; + $php_date = "F Y"; + break; + + default: + // weekly + $sql_date = "%U %Y"; + $php_date = " [F Y]"; + break; + } + + $DB->query("SELECT MAX($sql_field) as result_maxdate, + COUNT(*) as result_count, + DATE_FORMAT(from_unixtime($sql_field),'$sql_date') AS result_time + FROM $sql_table + WHERE $sql_field > '$from_time' + AND $sql_field < '$to_time' + GROUP BY result_time + ORDER BY $sql_field {$IN['sortby']}"); + + $running_total = 0; + $max_result = 0; + + $results = array(); + + $SKIN->td_header[] = array( "Date" , "20%" ); + $SKIN->td_header[] = array( "Result" , "70%" ); + $SKIN->td_header[] = array( "Count" , "10%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( ucfirst($IN['timescale']) + ." ".$table + ." ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} to" + ." {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})" + ); + + if ( $DB->get_num_rows() ) + { + + while ($row = $DB->fetch_row() ) + { + + if ( $row['result_count'] > $max_result ) + { + $max_result = $row['result_count']; + } + + $running_total += $row['result_count']; + + $results[] = array( + 'result_maxdate' => $row['result_maxdate'], + 'result_count' => $row['result_count'], + 'result_time' => $row['result_time'], + ); + + } + + foreach( $results as $pOOp => $data ) + { + + $img_width = intval( ($data['result_count'] / $max_result) * 100 - 8) . "%"; + + if ($IN['timescale'] == 'weekly') + { + $date = "Week #".strftime("%W", $data['result_maxdate']) . date( $php_date, $data['result_maxdate'] ); + } + else + { + $date = date( $php_date, $data['result_maxdate'] ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( $date, + "", + "
    ".$data['result_count']."
    ", + ) ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( ' ', + "
    Total
    ", + "
    ".$running_total."
    ", + ) ); + + } + else + { + $ADMIN->html .= $SKIN->add_td_basic( "No results found", "center" ); + } + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + //+--------------------------------------------------------------------------------- + //| Date selection screen + //+--------------------------------------------------------------------------------- + + function main_screen($mode='reg') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $ADMIN->page_title = "Statistic Center"; + + $ADMIN->page_detail = "Please define the date ranges and other options below.
    Note: The statistics generated are based on the information currently held in the database, they do not take into account pruned forums or delete posts, etc."; + + if ($mode == 'reg') + { + $form_code = 'show_reg'; + + $table = 'Registration Statistics'; + } + else if ($mode == 'topic') + { + $form_code = 'show_topic'; + + $table = 'New Topic Statistics'; + } + else if ($mode == 'post') + { + $form_code = 'show_post'; + + $table = 'Post Statistics'; + } + else if ($mode == 'msg') + { + $form_code = 'show_msg'; + + $table = 'PM Statistics'; + } + else if ($mode == 'views') + { + $form_code = 'show_views'; + + $table = 'Topic View Statistics'; + } + + + $old_date = getdate(time() - (3600 * 24 * 90)); + $new_date = getdate(time() + (3600 * 24)); + + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $form_code ), + 2 => array( 'act' , 'stats' ), + ) ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( $table ); + + + $ADMIN->html .= $SKIN->add_td_row( array( "Date From" , + $SKIN->form_dropdown( "from_month" , $this->make_month(), $old_date['mon'] ).'  '. + $SKIN->form_dropdown( "from_day" , $this->make_day() , $old_date['mday'] ).'  '. + $SKIN->form_dropdown( "from_year" , $this->make_year() , $old_date['year'] ) + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( "Date To" , + $SKIN->form_dropdown( "to_month" , $this->make_month(), $new_date['mon'] ).'  '. + $SKIN->form_dropdown( "to_day" , $this->make_day() , $new_date['mday'] ).'  '. + $SKIN->form_dropdown( "to_year" , $this->make_year() , $new_date['year'] ) + ) ); + + if ($mode != 'views') + { + $ADMIN->html .= $SKIN->add_td_row( array( "Time scale" , + $SKIN->form_dropdown( "timescale" , array( 0 => array( 'daily', 'Daily'), 1 => array( 'weekly', 'Weekly' ), 2 => array( 'monthly', 'Monthly' ) ) ) + ) ); + } + + $ADMIN->html .= $SKIN->add_td_row( array( "Result Sorting" , + $SKIN->form_dropdown( "sortby" , array( 0 => array( 'asc', 'Ascending - Oldest dates first'), 1 => array( 'desc', 'Descending - Newest dates first' ) ), 'desc' ) + ) ); + + $ADMIN->html .= $SKIN->end_form("Show"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + + } + + //+--------------------------------------------------------------------------------- + + function make_year() + { + $time_now = getdate(); + + $return = array(); + + $start_year = 2002; + + $latest_year = intval($time_now['year']); + + if ($latest_year == $start_year) + { + $start_year -= 1; + } + + for ( $y = $start_year; $y <= $latest_year; $y++ ) + { + $return[] = array( $y, $y); + } + + return $return; + } + + //+---------------------------------------- + + function make_month() + { + $return = array(); + + for ( $m = 1 ; $m <= 12; $m++ ) + { + $return[] = array( $m, $this->month_names[$m] ); + } + + return $return; + } + + //+---------------------------------------- + + function make_day() + { + $return = array(); + + for ( $d = 1 ; $d <= 31; $d++ ) + { + $return[] = array( $d, $d ); + } + + return $return; + } + + + +} + + +?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_stylesets.php b/upload/sources/Admin/ad_stylesets.php index 6bcd0f16..2fd42483 100644 --- a/upload/sources/Admin/ad_stylesets.php +++ b/upload/sources/Admin/ad_stylesets.php @@ -1,862 +1,922 @@ - Help Control functions -| > Module written by Matt Mecham -| > Date started: 2nd April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'wrapper': - $this->list_wrappers(); - break; - - case 'add': - $this->do_form('add'); - break; - - case 'edit': - $this->do_form('edit'); - break; - - case 'doadd': - $this->save_skin('add'); - break; - - case 'doedit': - $this->save_skin('edit'); - break; - - case 'remove': - $this->remove(); - break; - - //------------------------- - case 'memskins': - $this->mem_skins(); - break; - - case 'export': - $this->export(); - break; - - default: - $this->list_sets(); - break; - } - - } - - //---------------------------------------------------- - - function export() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing skin set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_skins WHERE uid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_images WHERE imid='".$row['img_id']."'"); - - if ( ! $img = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_css WHERE cssid='".$row['css_id']."'"); - - if ( ! $css = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - - //+------------------------------- - - $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$row['set_id']."'"); - - if ( ! $tmpl = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_templates WHERE tmid='".$row['tmpl_id']."'"); - - if ( ! $wrap = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - - //+------------------------------- - - if ($INFO['base_dir'] == './') - { - $INFO['base_dir'] = str_replace( '\\', '/', getcwd() ) . '/'; - } - - $archive_dir = $INFO['base_dir']."archive_out"; - $images_dir = $INFO['base_dir']."style_images/".$img['imid']; - $css_file = $INFO['base_dir']."style_sheets/stylesheet_{$css['cssid']}.css"; - $templates_dir = $INFO['base_dir']."style_templates/".$tmpl['skid']; - - require $root_dir."sources/lib/tar.php"; - - if (!is_dir($archive_dir)) - { - $ADMIN->error("Could not locate $archive_dir, is the directory there?"); - } - - if (!is_writeable($archive_dir)) - { - $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); - } - - if (!file_exists($css_file)) - { - $ADMIN->error("Could not locate $css_file, is the directory there?"); - } - - if (!is_dir($templates_dir)) - { - $ADMIN->error("Could not locate $templates_dir, is the directory there?"); - } - - if (!is_dir($images_dir)) - { - $ADMIN->error("Could not locate $images_dir, is the directory there?"); - } - - //+------------------------------- - // Set up the dir structure - //+------------------------------- - - $css_name = "stylesheet.css"; - $wrap_name = "wrapper.html"; - - $img_dir = 'images'; - $templ_dir = 'templates'; - - $pack_name = preg_replace( "/\s{1,}/", "_", $row['sname'] ); - - $new_dir = "set-".$pack_name; - - //+------------------------------- - - if ( ! mkdir($archive_dir."/".$new_dir, 0777) ) - { - $ADMIN->error("Directory creation failed, cannot export skin set. Please check the permission in 'archive_out'"); - } - - //+------------------------------- - - if ( ! mkdir($archive_dir."/".$new_dir."/".$img_dir, 0777) ) - { - $ADMIN->error("Directory creation failed, cannot export skin set. Please check the permission in 'archive_out'"); - } - - //+------------------------------- - - if ( ! mkdir($archive_dir."/".$new_dir."/".$templ_dir, 0777) ) - { - $ADMIN->error("Directory creation failed, cannot export skin set. Please check the permission in 'archive_out'"); - } - - //+------------------------------- - // Make the wrapper file... - //+------------------------------- - - $wrap['template'] = preg_replace("/\r/", "\n", $wrap['template'] ); - - $FH = fopen($archive_dir."/".$new_dir."/".$wrap_name, 'w'); - fwrite($FH, $wrap['template'], strlen($wrap['template'])); - fclose($FH); - - @chmod($archive_dir."/".$new_dir."/".$wrap_name, 0777); - - //+------------------------------- - // Make the css file... - //+------------------------------- - - if ( ! copy($css_file, $archive_dir."/".$new_dir."/".$css_name) ) - { - $ADMIN->error("COPY FAILED ON STYLE SHEET $css_name, maybe the script has insufficient permissions?"); - } - - @chmod($archive_dir."/".$new_dir."/".$css_name, 0777); - - //+------------------------------- - // Copy over the images... - //+------------------------------- - - if ( ! $ADMIN->copy_dir($images_dir, $archive_dir."/".$new_dir."/".$img_dir) ) - { - $ADMIN->error( $ADMIN->errors ); - } - - // Generate the config file.. - - $file_content = " $v) - { - - $v = preg_replace( "#style_images/".$img['imid']."/#", "style_images/%img_dir%/", $v ); - - $file_content .= "\n\$config['$k'] = \"".addslashes($v)."\";"; - } - - $file_content .= "\n\n?".">"; - - $FH = fopen($archive_dir."/".$new_dir."/"."img_conf.inc", 'w'); - fwrite($FH, $file_content, strlen($file_content)); - fclose($FH); - - //+------------------------------- - // Copy over the skin templates... - //+------------------------------- - - if ( ! $ADMIN->copy_dir($templates_dir, $archive_dir."/".$new_dir."/".$templ_dir) ) - { - $ADMIN->error( $ADMIN->errors ); - } - - // Generate the config file.. - - $file_content = " \"".addslashes($tmpl['author'])."\", ". - "'email'=>\"".addslashes($tmpl['email'])."\", ". - "'tbl_border'=>\"".addslashes($row['tbl_border'])."\", ". - "'tbl_width'=>\"".addslashes($row['tbl_width'])."\", ". - "'url'=>\"".addslashes($tmpl['url'])."\")\n\n?".">"; - - $FH = fopen($archive_dir."/".$new_dir."/"."templates_conf.inc", 'w'); - fwrite($FH, $file_content, strlen($file_content)); - fclose($FH); - - //+------------------------------- - // Add files and write tarball - //+------------------------------- - - $tar = new tar(); - - $tar->new_tar( $archive_dir, $new_dir.".tar" ); - $tar->add_directory( $archive_dir."/".$new_dir ); - $tar->write_tar(); - - // Check for errors. - - if ($tar->error != "") - { - $ADMIN->error($tar->error); - } - - // remove original unarchived directory - - $ADMIN->rm_dir($archive_dir."/".$new_dir); - - $ADMIN->done_screen("Skin Pack Export Created

    You can download the tar-chive here", "Manage Skin Sets", "act=sets" ); - - - } - - //---------------------------------------------- - - function mem_skins() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - $DB->query("SELECT sid FROM ibf_skins WHERE uid='".$IN['oid']."'"); - $old = $DB->fetch_row(); - - if ($IN['nid'] == 'n') - { - $DB->query("UPDATE ibf_members SET skin=NULL WHERE skin='".$old['sid']."'"); - } - else - { - $DB->query("SELECT sid FROM ibf_skins WHERE uid='".$IN['nid']."'"); - $new = $DB->fetch_row(); - $DB->query("UPDATE ibf_members SET skin='".$new['sid']."' WHERE skin='".$old['sid']."'"); - } - - $ADMIN->done_screen("Member Skin Choices Updated", "Manage Skin Sets", "act=sets" ); - - } - - - //------------------------------------------------------------- - // REMOVE WRAPPERS - //------------------------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing skin set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * FROM ibf_skins WHERE uid='".$IN['id']."'"); - - if (! $skin = $DB->fetch_row() ) - { - $ADMIN->error("Could not query that skin set information from the DB"); - } - - //+------------------------------- - - if ($skin['default_set'] == 1) - { - $ADMIN->error("You can not remove this skin set as it is set as the default. Set another skin as default and try again"); - } - - //+------------------------------- - - // Update the members skins.. - - $DB->query("UPDATE ibf_members SET skin='' WHERE skin='".$skin['sid']."'"); - - // Update the forums DB - - $DB->query("SELECT id FROM ibf_forums WHERE skin_id='".$skin['sid']."'"); - - if ( $DB->get_num_rows() ) - { - $arr = array(); - - while ( $i = $DB->fetch_row() ) - { - $arr['forum_skin_'.$i['id']] = ''; - } - - $DB->query("UPDATE ibf_forums SET skin_id='' WHERE skin_id='".$skin['sid']."'"); - - // Remove it from the config file.. - - $ADMIN->rebuild_config($arr); - - } - - // Remove skin from the DB - - $DB->query("DELETE FROM ibf_skins WHERE uid='".$IN['id']."'"); - - $std->boink_it($SKIN->base_url."&act=sets"); - - exit(); - - - } - - - - //------------------------------------------------------------- - // ADD / EDIT SKIN SETS - //------------------------------------------------------------- - - function save_skin( $type='add' ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - if ($type == 'edit') - { - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing skin set ID, go back and try again"); - } - } - - if ($IN['sname'] == "") - { - $ADMIN->error("You must specify a name for this skin pack ID"); - } - - if ($IN['tbl_width'] == "") - { - $ADMIN->error("You must specify a table width"); - } - - $barney = array( 'sname' => stripslashes($HTTP_POST_VARS['sname']), - 'set_id' => $IN['template'], - 'tmpl_id' => $IN['wrapper'], - 'img_id' => $IN['image'], - 'css_id' => $IN['css'], - 'tbl_border' => $IN['tbl_border'], - 'tbl_width' => $IN['tbl_width'], - 'hidden' => $IN['hidden'], - 'default_set'=> $IN['default_set'], - ); - - if ($type == 'add') - { - - $DB->query("SELECT MAX(sid) as new_id FROM ibf_skins"); - - $row = $DB->fetch_row(); - - $barney['sid'] = $row['new_id'] + 1; - - $db_string = $DB->compile_db_insert_string( $barney ); - - $DB->query("INSERT INTO ibf_skins (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - if ($IN['default_set'] == 1) - { - $DB->query("UPDATE ibf_skins SET default_set=0 WHERE sid <> '".$barney['sid']."'"); - } - - $std->boink_it($SKIN->base_url."&act=sets"); - - exit(); - - } - else - { - $db_string = $DB->compile_db_update_string( $barney ); - - $DB->query("UPDATE ibf_skins SET $db_string WHERE uid='".$IN['id']."'"); - - if ($IN['default_set'] == 1) - { - $DB->query("UPDATE ibf_skins SET default_set=0 WHERE uid <> '".$IN['id']."'"); - } - - $ADMIN->done_screen("Skin Set Updated", "Manage Skin Sets", "act=sets" ); - } - - - } - - //------------------------------------------------------------- - // ADD / EDIT SETS - //------------------------------------------------------------- - - function do_form( $type='add' ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - - $css = array(); - $wrappers = array(); - $templates = array(); - $images = array(); - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_skins WHERE uid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $DB->query("SELECT imid, setname FROM ibf_images"); - - while( $img = $DB->fetch_row() ) - { - $images[] = array( $img['imid'], $img['setname'] ); - } - - //+------------------------------- - - $DB->query("SELECT cssid, css_name FROM ibf_css"); - - while ( $c = $DB->fetch_row() ) - { - $css[] = array( $c['cssid'], $c['css_name'] ); - } - - //+------------------------------- - - $DB->query("SELECT tmid, name FROM ibf_templates"); - - while ( $t = $DB->fetch_row() ) - { - $wrappers[] = array( $t['tmid'], $t['name'] ); - } - - //+------------------------------- - - $DB->query("SELECT skid, skname FROM ibf_tmpl_names"); - - while ( $s = $DB->fetch_row() ) - { - $templates[] = array( $s['skid'], $s['skname'] ); - } - - - //+------------------------------- - - if ($type == 'add') - { - $code = 'doadd'; - $button = 'Create Skin Set'; - $row['sname'] = $row['sname'].".2"; - $row['default_set'] = 0; - } - else - { - $code = 'doedit'; - $button = 'Edit Skin Set'; - } - - //+------------------------------- - - $ADMIN->page_detail = "You may mix n' match which skin resources you wish to apply to this skin set."; - $ADMIN->page_title = "Manage Skin Sets"; - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), - 2 => array( 'act' , 'sets' ), - 3 => array( 'id' , $IN['id'] ), - ), "theAdminForm", "onSubmit=\"return no_specialchars('sets')\"" ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( $button ); - - $ADMIN->html .= $SKIN->js_no_specialchars(); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Skin Set Title", - $SKIN->form_input('sname', $row['sname']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Use Templates:", - $SKIN->form_dropdown('template', $templates, $row['set_id']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Use Image & Macro Set:", - $SKIN->form_dropdown('image', $images, $row['img_id']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Use Stylesheet:", - $SKIN->form_dropdown('css', $css, $row['css_id']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Use Wrapper:", - $SKIN->form_dropdown('wrapper', $wrappers, $row['tmpl_id']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Basic Table Width:", - $SKIN->form_input('tbl_width', $row['tbl_width']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Basic Table Border Colour:", - $SKIN->form_input('tbl_border', $row['tbl_border']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Hide from Members?
    Useful if you want to make a forum only skin", - $SKIN->form_yes_no('hidden', $row['hidden']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Set as default skin set?
    Used for unallocted forum and member skins", - $SKIN->form_yes_no('default_set', $row['default_set']), - ) ); - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - - } - - //------------------------------------------------------------- - // SHOW WRAPPERS - //------------------------------------------------------------- - - function list_sets() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - - $forums = array(); - $forum_skins = array(); - - $ADMIN->page_detail = "You may add/edit and remove skin sets.

    Skin sets are groups of style resources. You can mix n' match board wrappers, image and macro sets, stylesheets and skin templates. If you wish to edit any of the resources, please choose the resource you wish to manage from the menu bar on the left."; - $ADMIN->page_title = "Manage Skin Sets"; - - //+------------------------------- - - $DB->query("SELECT id, name FROM ibf_forums"); - - while ( $f = $DB->fetch_row() ) - { - $forums[ $f['id'] ] = $f['name']; - - if ($INFO['forum_skin_'.$f['id']] != "") - { - $forum_skins[ $INFO['forum_skin_'.$f['id']] ][] = $f['name']; - } - } - - - $SKIN->td_header[] = array( "Title" , "40%" ); - $SKIN->td_header[] = array( "No. Members" , "20%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - $SKIN->td_header[] = array( "Hidden" , "5%" ); - $SKIN->td_header[] = array( "Default" , "5%" ); - - //+------------------------------- - - $DB->query("select ibf_skins.*, count(ibf_members.id) as mcount from ibf_skins left join ibf_members on(ibf_members.skin=ibf_skins.sid) where (ibf_members.skin is not null or ibf_skins.default_set = 1) group by ibf_skins.sid order by ibf_skins.sname"); - - $used_ids = array(); - - if ( $DB->get_num_rows() ) - { - - $ADMIN->html .= $SKIN->start_table( "Current Skins Used by Members" ); - - while ( $r = $DB->fetch_row() ) - { - $extra = ""; - - if ( is_array($forum_skins[ $r['sid'] ]) ) - { - if ( count($forum_skins[ $r['sid'] ]) > 0 ) - { - $extra = "
    (Used in forums: ".implode( ",", $forum_skins[ $r['sid'] ] )." )"; - } - } - - $default = ' '; - $hidden = ' '; - - if ($r['hidden'] == 1) - { - $hidden = "X"; - } - - if ($r['default_set'] == 1) - { - $default = "X"; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['sname'])."$extra", - "
    ".$r['mcount']."
    ", - "
    Export
    ", - "
    Edit
    ", - "
    Remove
    ", - "
    $hidden
    ", - "
    $default
    ", - ) ); - - $used_ids[] = $r['uid']; - - $form_array[] = array( $r['uid'], $r['sname'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - - if ( count($used_ids) > 0 ) - { - - $DB->query("SELECT * FROM ibf_skins WHERE uid NOT IN(".implode(",",$used_ids).")"); - - if ( $DB->get_num_rows() ) - { - - $SKIN->td_header[] = array( "Title" , "60%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - $SKIN->td_header[] = array( "Hidden" , "5%" ); - $SKIN->td_header[] = array( "Default", "5%" ); - - $ADMIN->html .= $SKIN->start_table( "Skin Sets not used by Members" ); - - while ( $r = $DB->fetch_row() ) - { - - $extra = ""; - - if ( is_array($forum_skins[ $r['sid'] ]) ) - { - if ( count($forum_skins[ $r['sid'] ]) > 0 ) - { - $extra = "
    (Used in forums: ".implode( ",", $forum_skins[ $r['sid'] ] )." )"; - } - } - - $default = ' '; - $hidden = ' '; - - if ($r['hidden'] == 1) - { - $hidden = "X"; - } - - if ($r['default_set'] == 1) - { - $default = "X"; - } - - $ADMIN->html .= $SKIN->js_checkdelete(); - - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['sname'])."$extra", - "
    Export
    ", - "
    Edit
    ", - "
    Remove
    ", - "
    $hidden
    ", - "
    $default
    ", - ) ); - - $form_array[] = array( $r['uid'], $r['sname'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - } - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'sets' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Create New Skin Set" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Base new skin set on..." , - $SKIN->form_dropdown( "id", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Create new Skin Set"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'memskins' ), - 2 => array( 'act' , 'sets' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Swop members skin choice" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Where members use skin...", - $SKIN->form_dropdown( "oid", $form_array) - ) ); - - $form_array[] = array( 'n', 'None (Will use whatever is set as default)' ); - - $ADMIN->html .= $SKIN->add_td_row( array( "update to use skin...", - $SKIN->form_dropdown( "nid", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Update members skin choice"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - -} - - + Help Control functions +| > Module written by Matt Mecham +| > Date started: 2nd April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'wrapper': + $this->list_wrappers(); + break; + + case 'add': + $this->do_form('add'); + break; + + case 'edit': + $this->do_form('edit'); + break; + + case 'doadd': + $this->save_skin('add'); + break; + + case 'doedit': + $this->save_skin('edit'); + break; + + case 'remove': + $this->remove(); + break; + + //------------------------- + case 'memskins': + $this->mem_skins(); + break; + + case 'export': + $this->export(); + break; + + default: + $this->list_sets(); + break; + } + + } + + //---------------------------------------------------- + + function export() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing skin set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_skins WHERE uid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_macro_name WHERE set_id='".$row['macro_id']."'"); + + if ( ! $macro_name = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_css WHERE cssid='".$row['css_id']."'"); + + if ( ! $css = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + + //+------------------------------- + + $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$row['set_id']."'"); + + if ( ! $tmpl = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_templates WHERE tmid='".$row['tmpl_id']."'"); + + if ( ! $wrap = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + + //+------------------------------- + + if ($INFO['base_dir'] == './') + { + $INFO['base_dir'] = str_replace( '\\', '/', getcwd() ) . '/'; + } + + $archive_dir = $INFO['base_dir']."archive_out"; + $images_dir = $INFO['base_dir']."style_images/".$row['img_dir']; + + require $root_dir."sources/lib/tar.php"; + + if (!is_dir($archive_dir)) + { + $ADMIN->error("Could not locate $archive_dir, is the directory there?"); + } + + if (!is_writeable($archive_dir)) + { + $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); + } + + if (!is_dir($images_dir)) + { + $ADMIN->error("Could not locate $images_dir, is the directory there?"); + } + + //+------------------------------- + // Set up the dir structure + //+------------------------------- + + $css_name = "stylesheet.css"; + $wrap_name = "wrapper.html"; + $macro_name = "macro.txt"; + $template_name = "templates.html"; + + $img_dir = 'images'; + + $pack_name = preg_replace( "/\s{1,}/", "_", $row['sname'] ); + + $new_dir = "set-".$pack_name; + + //+------------------------------- + + if ( ! mkdir($archive_dir."/".$new_dir, 0777) ) + { + $ADMIN->error("Directory creation failed, cannot export skin set. Please check the permission in 'archive_out'"); + } + + //+------------------------------- + + if ( ! mkdir($archive_dir."/".$new_dir."/".$img_dir, 0777) ) + { + $ADMIN->error("Directory creation failed, cannot export skin set. Please check the permission in 'archive_out'"); + } + + //+------------------------------- + // Make the wrapper file... + //+------------------------------- + + $wrap['template'] = preg_replace("/\r/", "\n", $wrap['template'] ); + + $FH = fopen($archive_dir."/".$new_dir."/".$wrap_name, 'w'); + fwrite($FH, $wrap['template'], strlen($wrap['template'])); + fclose($FH); + + @chmod($archive_dir."/".$new_dir."/".$wrap_name, 0777); + + //+------------------------------- + // Make the css file... + //+------------------------------- + + $FH = fopen($archive_dir."/".$new_dir."/".$css_name, 'w'); + fwrite($FH, $css['css_text'], strlen($css['css_text'])); + fclose($FH); + + @chmod($archive_dir."/".$new_dir."/".$css_name, 0777); + + //+------------------------------- + // Copy over the images... + //+------------------------------- + + if ( ! $ADMIN->copy_dir($images_dir, $archive_dir."/".$new_dir."/".$img_dir) ) + { + $ADMIN->error( $ADMIN->errors ); + } + + //+------------------------------- + // Make the macro file... + //+------------------------------- + + $file_content = ""; + + $DB->query("SELECT macro_replace, macro_value FROM ibf_macro WHERE macro_set='".$row['macro_id']."'"); + + while( $mrow = $DB->fetch_row() ) + { + if ($mrow['macro_replace'] == "") + { + $mrow['macro_replace'] = "*UNASSIGNED*"; + } + $file_content .= $mrow['macro_value']."~=~".$mrow['macro_replace']."\n"; + } + + $FH = fopen($archive_dir."/".$new_dir."/".$macro_name, 'w'); + fwrite($FH, $file_content, strlen($file_content)); + fclose($FH); + + @chmod($archive_dir."/".$new_dir."/".$macro_name, 0777); + + //+---------------------------------------------------------------------------- + // Generate template HTML file + //+---------------------------------------------------------------------------- + + $output = ""; + + $groups = $DB->query("SELECT DISTINCT(group_name) FROM ibf_skin_templates WHERE set_id='".$row['set_id']."'"); + + if ( ! $DB->get_num_rows($groups) ) + { + $ADMIN->rm_dir($archive_dir); + $ADMIN->error("Export Failed at template set creation: Can't query the information from the database"); + } + + $output .= "\n\n"; + + while ( $trow = $DB->fetch_row($groups) ) + { + + $aq = $DB->query("SELECT * FROM ibf_skin_templates WHERE set_id='".$row['set_id']."' AND group_name='".$trow['group_name']."'"); + + if ( ! $DB->get_num_rows($aq) ) + { + $ADMIN->rm_dir($archive_dir); + $ADMIN->error("Can't query the information from the database"); + } + + $output .= "\n\n\n"; + + while ( $next_row = $DB->fetch_row($aq) ) + { + $text = $this->convert_tags($next_row['section_content']); + $text = str_replace( "\r\n", "\n", $text); + $text = str_replace( "\n\n", "\n", $text); + + $output .= "\n\n"; + $output .= $text."\n"; + $output .= "\n\n"; + } + + $output .= "\n\n"; + + } + + $FH = fopen($archive_dir."/".$new_dir."/".$template_name, 'w'); + fwrite($FH, $output, strlen($output)); + fclose($FH); + + @chmod($archive_dir."/".$new_dir."/".$template_name, 0777); + + //+---------------------------------------------------------------------------- + // Generate the config file.. + //+---------------------------------------------------------------------------- + + $file_content = " \"".addslashes($tmpl['author'])."\", ". + "'email'=>\"".addslashes($tmpl['email'])."\", ". + "'url'=>\"".addslashes($tmpl['url'])."\")\n\n?".">"; + + $FH = fopen($archive_dir."/".$new_dir."/"."templates_conf.inc", 'w'); + fwrite($FH, $file_content, strlen($file_content)); + fclose($FH); + + @chmod($archive_dir."/".$new_dir."/"."templates_conf.inc", 0777); + + //+------------------------------- + // Add files and write tarball + //+------------------------------- + + $tar = new tar(); + + $tar->new_tar( $archive_dir, $new_dir.".tar" ); + $tar->add_directory( $archive_dir."/".$new_dir ); + $tar->write_tar(); + + // Check for errors. + + if ($tar->error != "") + { + $ADMIN->rm_dir($archive_dir); + $ADMIN->error($tar->error); + } + + // remove original unarchived directory + + $ADMIN->rm_dir($archive_dir."/".$new_dir); + + $ADMIN->done_screen("Skin Pack Export Created

    You can download the tar-chive here", "Manage Skin Sets", "act=sets" ); + + + } + + //---------------------------------------------- + // I must get around to centralising this... + //---------------------------------------------- + + function convert_tags($t="") + { + if ($t == "") + { + return ""; + } + + $t = preg_replace( "/{?\\\$ibforums->base_url}?/" , "{ibf.script_url}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->session_id}?/" , "{ibf.session_id}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->skin\['?(\w+)'?\]}?/" , "{ibf.skin.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->lang\['?(\w+)'?\]}?/" , "{ibf.lang.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->vars\['?(\w+)'?\]}?/" , "{ibf.vars.\\1}" , $t ); + $t = preg_replace( "/{?\\\$ibforums->member\['?(\w+)'?\]}?/" , "{ibf.member.\\1}" , $t ); + + return $t; + + } + + //---------------------------------------------- + + function mem_skins() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + $DB->query("SELECT sid FROM ibf_skins WHERE uid='".$IN['oid']."'"); + $old = $DB->fetch_row(); + + if ($IN['nid'] == 'n') + { + $DB->query("UPDATE ibf_members SET skin=NULL WHERE skin='".$old['sid']."'"); + } + else + { + $DB->query("SELECT sid FROM ibf_skins WHERE uid='".$IN['nid']."'"); + $new = $DB->fetch_row(); + $DB->query("UPDATE ibf_members SET skin='".$new['sid']."' WHERE skin='".$old['sid']."'"); + } + + $ADMIN->done_screen("Member Skin Choices Updated", "Manage Skin Sets", "act=sets" ); + + } + + + //------------------------------------------------------------- + // REMOVE WRAPPERS + //------------------------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing skin set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_skins WHERE uid='".$IN['id']."'"); + + if (! $skin = $DB->fetch_row() ) + { + $ADMIN->error("Could not query that skin set information from the DB"); + } + + //+------------------------------- + + if ($skin['default_set'] == 1) + { + $ADMIN->error("You can not remove this skin set as it is set as the default. Set another skin as default and try again"); + } + + //+------------------------------- + + // Update the members skins.. + + $DB->query("UPDATE ibf_members SET skin='' WHERE skin='".$skin['sid']."'"); + + // Update the forums DB + + $DB->query("SELECT id FROM ibf_forums WHERE skin_id='".$skin['sid']."'"); + + if ( $DB->get_num_rows() ) + { + $arr = array(); + + while ( $i = $DB->fetch_row() ) + { + $arr['forum_skin_'.$i['id']] = ''; + } + + $DB->query("UPDATE ibf_forums SET skin_id='' WHERE skin_id='".$skin['sid']."'"); + + // Remove it from the config file.. + + $ADMIN->rebuild_config($arr); + + } + + // Remove skin from the DB + + $DB->query("DELETE FROM ibf_skins WHERE uid='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=sets"); + + exit(); + + + } + + + + //------------------------------------------------------------- + // ADD / EDIT SKIN SETS + //------------------------------------------------------------- + + function save_skin( $type='add' ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing skin set ID, go back and try again"); + } + } + + if ($IN['sname'] == "") + { + $ADMIN->error("You must specify a name for this skin pack ID"); + } + + + $barney = array( 'sname' => stripslashes($HTTP_POST_VARS['sname']), + 'set_id' => $IN['template'], + 'tmpl_id' => $IN['wrapper'], + 'img_dir' => $IN['img_dir'], + 'css_id' => $IN['css'], + 'hidden' => $IN['hidden'], + 'default_set'=> $IN['default_set'], + 'macro_id' => $IN['macro_id'], + ); + + if ($type == 'add') + { + + $DB->query("SELECT MAX(sid) as new_id FROM ibf_skins"); + + $row = $DB->fetch_row(); + + $barney['sid'] = $row['new_id'] + 1; + + $db_string = $DB->compile_db_insert_string( $barney ); + + $DB->query("INSERT INTO ibf_skins (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + if ($IN['default_set'] == 1) + { + $DB->query("UPDATE ibf_skins SET default_set=0 WHERE sid <> '".$barney['sid']."'"); + } + + $std->boink_it($SKIN->base_url."&act=sets"); + + exit(); + + } + else + { + $db_string = $DB->compile_db_update_string( $barney ); + + $DB->query("UPDATE ibf_skins SET $db_string WHERE uid='".$IN['id']."'"); + + if ($IN['default_set'] == 1) + { + $DB->query("UPDATE ibf_skins SET default_set=0 WHERE uid <> '".$IN['id']."'"); + } + + $ADMIN->done_screen("Skin Set Updated", "Manage Skin Sets", "act=sets" ); + } + + + } + + //------------------------------------------------------------- + // ADD / EDIT SETS + //------------------------------------------------------------- + + function do_form( $type='add' ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + $css = array(); + $wrappers = array(); + $templates = array(); + $macros = array(); + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_skins WHERE uid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $DB->query("SELECT * FROM ibf_macro_name"); + + while( $img = $DB->fetch_row() ) + { + $macros[] = array( $img['set_id'], $img['set_name'] ); + } + + //+------------------------------- + + $DB->query("SELECT cssid, css_name FROM ibf_css"); + + while ( $c = $DB->fetch_row() ) + { + $css[] = array( $c['cssid'], $c['css_name'] ); + } + + //+------------------------------- + + $DB->query("SELECT tmid, name FROM ibf_templates"); + + while ( $t = $DB->fetch_row() ) + { + $wrappers[] = array( $t['tmid'], $t['name'] ); + } + + //+------------------------------- + + $DB->query("SELECT skid, skname FROM ibf_tmpl_names"); + + while ( $s = $DB->fetch_row() ) + { + $templates[] = array( $s['skid'], $s['skname'] ); + } + + + //+------------------------------- + + if ($type == 'add') + { + $code = 'doadd'; + $button = 'Create Skin Set'; + $row['sname'] = $row['sname'].".2"; + $row['default_set'] = 0; + } + else + { + $code = 'doedit'; + $button = 'Edit Skin Set'; + } + + $dirs = array(); + + $dh = opendir( './style_images' ); + while ( $file = readdir( $dh ) ) + { + if (($file != ".") && ($file != "..")) + { + if ( is_dir('./style_images/'.$file) ) + { + $dirs[] = array( $file, $file ); + } + } + } + closedir( $dh ); + + + + //+------------------------------- + + $ADMIN->page_detail = "You may mix n' match which skin resources you wish to apply to this skin set."; + $ADMIN->page_title = "Manage Skin Sets"; + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), + 2 => array( 'act' , 'sets' ), + 3 => array( 'id' , $IN['id'] ), + ), "theAdminForm", "onSubmit=\"return no_specialchars('sets')\"" ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( $button ); + + $ADMIN->html .= $SKIN->js_no_specialchars(); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Skin Set Title", + $SKIN->form_input('sname', $row['sname']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Use Templates:", + $SKIN->form_dropdown('template', $templates, $row['set_id']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Use Macro Set:", + $SKIN->form_dropdown('macro_id', $macros, $row['macro_id']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Use Image Directory:", + $SKIN->form_dropdown('img_dir', $dirs, $row['img_dir']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Use Stylesheet:", + $SKIN->form_dropdown('css', $css, $row['css_id']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Use Wrapper:", + $SKIN->form_dropdown('wrapper', $wrappers, $row['tmpl_id']), + ) ); + + + $ADMIN->html .= $SKIN->add_td_row( array( + "Hide from Members?
    Useful if you want to make a forum only skin", + $SKIN->form_yes_no('hidden', $row['hidden']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Set as default skin set?
    Used for unallocted forum and member skins", + $SKIN->form_yes_no('default_set', $row['default_set']), + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + + } + + //------------------------------------------------------------- + // SHOW WRAPPERS + //------------------------------------------------------------- + + function list_sets() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + + $forums = array(); + $forum_skins = array(); + + $ADMIN->page_detail = "You may add/edit and remove skin sets.

    Skin sets are groups of style resources. You can mix n' match board wrappers, image and macro sets, stylesheets and skin templates. If you wish to edit any of the resources, please choose the resource you wish to manage from the menu bar on the left."; + $ADMIN->page_title = "Manage Skin Sets"; + + //+------------------------------- + + $DB->query("SELECT id, name FROM ibf_forums"); + + while ( $f = $DB->fetch_row() ) + { + $forums[ $f['id'] ] = $f['name']; + + if ($INFO['forum_skin_'.$f['id']] != "") + { + $forum_skins[ $INFO['forum_skin_'.$f['id']] ][] = $f['name']; + } + } + + + $SKIN->td_header[] = array( "Title" , "40%" ); + $SKIN->td_header[] = array( "No. Members" , "20%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + $SKIN->td_header[] = array( "Hidden" , "5%" ); + $SKIN->td_header[] = array( "Default" , "5%" ); + + //+------------------------------- + + $DB->query("select ibf_skins.*, count(ibf_members.id) as mcount from ibf_skins left join ibf_members on(ibf_members.skin=ibf_skins.sid) where (ibf_members.skin is not null or ibf_skins.default_set = 1) group by ibf_skins.sid order by ibf_skins.sname"); + + $used_ids = array(); + + if ( $DB->get_num_rows() ) + { + + $ADMIN->html .= $SKIN->start_table( "Current Skins Used by Members" ); + + while ( $r = $DB->fetch_row() ) + { + $extra = ""; + + if ( is_array($forum_skins[ $r['sid'] ]) ) + { + if ( count($forum_skins[ $r['sid'] ]) > 0 ) + { + $extra = "
    (Used in forums: ".implode( ",", $forum_skins[ $r['sid'] ] )." )"; + } + } + + $default = ' '; + $hidden = ' '; + + if ($r['hidden'] == 1) + { + $hidden = "X"; + } + + if ($r['default_set'] == 1) + { + $default = "X"; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['sname'])."$extra", + "
    ".$r['mcount']."
    ", + "
    Export
    ", + "
    Edit
    ", + "
    Remove
    ", + "
    $hidden
    ", + "
    $default
    ", + ) ); + + $used_ids[] = $r['uid']; + + $form_array[] = array( $r['uid'], $r['sname'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + + if ( count($used_ids) > 0 ) + { + + $DB->query("SELECT * FROM ibf_skins WHERE uid NOT IN(".implode(",",$used_ids).")"); + + if ( $DB->get_num_rows() ) + { + + $SKIN->td_header[] = array( "Title" , "60%" ); + $SKIN->td_header[] = array( "Export" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + $SKIN->td_header[] = array( "Hidden" , "5%" ); + $SKIN->td_header[] = array( "Default", "5%" ); + + $ADMIN->html .= $SKIN->start_table( "Skin Sets not used by Members" ); + + while ( $r = $DB->fetch_row() ) + { + + $extra = ""; + + if ( is_array($forum_skins[ $r['sid'] ]) ) + { + if ( count($forum_skins[ $r['sid'] ]) > 0 ) + { + $extra = "
    (Used in forums: ".implode( ",", $forum_skins[ $r['sid'] ] )." )"; + } + } + + $default = ' '; + $hidden = ' '; + + if ($r['hidden'] == 1) + { + $hidden = "X"; + } + + if ($r['default_set'] == 1) + { + $default = "X"; + } + + $ADMIN->html .= $SKIN->js_checkdelete(); + + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['sname'])."$extra", + "
    Export
    ", + "
    Edit
    ", + "
    Remove
    ", + "
    $hidden
    ", + "
    $default
    ", + ) ); + + $form_array[] = array( $r['uid'], $r['sname'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + } + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'sets' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Create New Skin Set" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Base new skin set on..." , + $SKIN->form_dropdown( "id", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Create new Skin Set"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'memskins' ), + 2 => array( 'act' , 'sets' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Swop members skin choice" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Where members use skin...", + $SKIN->form_dropdown( "oid", $form_array) + ) ); + + $form_array[] = array( 'n', 'None (Will use whatever is set as default)' ); + + $ADMIN->html .= $SKIN->add_td_row( array( "update to use skin...", + $SKIN->form_dropdown( "nid", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Update members skin choice"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_stylesheets.php b/upload/sources/Admin/ad_stylesheets.php index a7c57dd8..fe5c8d54 100644 --- a/upload/sources/Admin/ad_stylesheets.php +++ b/upload/sources/Admin/ad_stylesheets.php @@ -1,502 +1,887 @@ - CSS management functions -| > Module written by Matt Mecham -| > Date started: 4th April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'wrapper': - $this->list_sheets(); - break; - - case 'add': - $this->do_form('add'); - break; - - case 'edit': - $this->do_form('edit'); - break; - - case 'doadd': - $this->save_wrapper('add'); - break; - - case 'doedit': - $this->save_wrapper('edit'); - break; - - case 'remove': - $this->remove(); - break; - - case 'export': - $this->export(); - break; - - //------------------------- - default: - $this->list_sheets(); - break; - } - - } - - function export() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing CSS ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_css WHERE cssid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $archive_dir = $INFO['base_dir']."/archive_out"; - - $css_file = $INFO['base_dir']."/style_sheets/stylesheet_{$row['cssid']}.css"; - - if (!is_dir($archive_dir)) - { - $ADMIN->error("Could not locate $archive_dir, is the directory there?"); - } - - if (!is_writeable($archive_dir)) - { - $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); - } - - if (!file_exists($css_file)) - { - $ADMIN->error("Cannot locate $css_file, please ensure that the file is in the proper directory"); - } - - //+------------------------------- - // Attempt to copy the files to the - // working directory... - //+------------------------------- - - $l_name = preg_replace( "/\s{1,}/", "_", $row['css_name'] ); - - $file_name = "css-".$l_name.".css"; - - if ( ! copy($css_file, $archive_dir."/".$file_name) ) - { - $ADMIN->error("COPY FAILED ON STYLE SHEET $file_name, maybe the script has insufficient permissions?"); - } - - @chmod($archive_dir."/".$file_name, 0777); - - $ADMIN->done_screen("Style Sheet Export Created

    You can download the CSS resource here", "Manage Style Sheets", "act=style" ); - - - } - - - //------------------------------------------------------------- - // REMOVE WRAPPERS - //------------------------------------------------------------- - - function remove() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing stylesheet ID, go back and try again"); - } - - $DB->query("DELETE FROM ibf_css WHERE cssid='".$IN['id']."'"); - - @unlink( $root_path."style_sheets/stylesheet_{$IN['id']}.css" ); - - $std->boink_it($SKIN->base_url."&act=style"); - - exit(); - - - } - - - - //------------------------------------------------------------- - // ADD / EDIT WRAPPERS - //------------------------------------------------------------- - - function save_wrapper( $type='add' ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - //+------------------------------- - - if ($type == 'edit') - { - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing CSS ID, go back and try again"); - } - - $file = $root_path."style_sheets/stylesheet_".$IN['id'].".css"; - - if ( ! is_writeable($file) ) - { - $ADMIN->error("IBF does not have permission to write to that file. Try setting the CHMOD on $file to 0777 and try again. You can do this via FTP"); - } - - } - - if ($IN['name'] == "") - { - $ADMIN->error("You must specify a name for this stylesheet"); - } - - if ($IN['css'] == "") - { - $ADMIN->error("You can't have an empty stylesheet, can you?"); - } - - $css = stripslashes($HTTP_POST_VARS['css']); - - $barney = array( 'css_name' => stripslashes($HTTP_POST_VARS['name']), - 'css_text' => $css, - ); - - if ($type == 'add') - { - $db_string = $DB->compile_db_insert_string( $barney ); - - $DB->query("INSERT INTO ibf_css (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); - - $new_id = $DB->get_insert_id(); - - $nfile = $root_path."style_sheets/stylesheet_".$new_id.".css"; - - if ($fh = fopen( $nfile, 'w' ) ) - { - fwrite( $fh, $css, strlen($css) ); - fclose( $fh ); - - @chmod( $nfile, 0777 ); - } - else - { - $DB->query("DELETE FROM ibf_css WHERE cssid='$new_id'"); - - $ADMIN->error("Could not prepare $file for creation - please check the CHMOD value of the 'style_sheets' directory and where possible CHMOD to 0777 via FTP"); - } - - $std->boink_it($SKIN->base_url."&act=style"); - - exit(); - - } - else - { - $db_string = $DB->compile_db_update_string( $barney ); - - if ($fh = fopen( $file, 'w' ) ) - { - fwrite( $fh, $css, strlen($css) ); - fclose( $fh ); - - @chmod( $file, 0777 ); - - $DB->query("UPDATE ibf_css SET $db_string WHERE cssid='".$IN['id']."'"); - - $ADMIN->done_screen("Stylesheet updated", "Manage Style Sheets", "act=style" ); - } - else - { - - $ADMIN->error("Could not prepare $file for writing - please check the CHMOD value of the 'style_sheets' directory"); - } - - } - - - } - - //------------------------------------------------------------- - // ADD / EDIT WRAPPERS - //------------------------------------------------------------- - - function do_form( $type='add' ) - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - //+------------------------------- - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT cssid, css_name FROM ibf_css WHERE cssid='".$IN['id']."'"); - - if ( ! $cssinfo = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the CSS details from the database"); - } - - //+------------------------------- - - $file = $root_path."style_sheets/stylesheet_".$IN['id'].".css"; - - if ( ! file_exists($file) ) - { - $ADMIN->error("Could not load the stylesheet. No file found at $file"); - } - - if ( ! is_readable($file) ) - { - $ADMIN->error("IBF does not have permission to read from that file. Try setting the CHMOD on $file to 0777 and try again. You can do this via FTP"); - } - - //+------------------------------- - - $fh = fopen( $file, 'r' ); - $css = fread( $fh, filesize($file) ); - fclose($fh); - - if ($type == 'add') - { - $code = 'doadd'; - $button = 'Create StyleSheet'; - $cssinfo['css_name'] = $cssinfo['css_name'].".2"; - } - else - { - // Availability test - - if ( ! is_writeable($file) ) - { - $ADMIN->error("IBF does not have permission to write to that file. Try setting the CHMOD on $file to 0777 and try again. You can do this via FTP"); - } - - $code = 'doedit'; - $button = 'Edit Stylesheet'; - } - - //+------------------------------- - - $ADMIN->page_detail = "You may use CSS fully when adding or editing stylesheets."; - $ADMIN->page_title = "Manage Style Sheets"; - - //+------------------------------- - - $ADMIN->html .= $SKIN->js_no_specialchars(); - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), - 2 => array( 'act' , 'style' ), - 3 => array( 'id' , $IN['id'] ), - ), "theAdminForm", "onSubmit=\"return no_specialchars('csssheet')\"" ); - - //+------------------------------- - - $SKIN->td_header[] = array( " " , "20%" ); - $SKIN->td_header[] = array( " " , "80%" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->start_table( $button ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Stylesheet Title", - $SKIN->form_input('name', $cssinfo['css_name']), - ) ); - - $ADMIN->html .= $SKIN->add_td_row( array( - "Content", - $SKIN->form_textarea('css', $css, "70", "30"), - ) ); - - $ADMIN->html .= $SKIN->end_form($button); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - - } - - //------------------------------------------------------------- - // SHOW STYLE SHEETS - //------------------------------------------------------------- - - function list_sheets() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - $form_array = array(); - $show_array = array(); - - $ADMIN->page_detail = "You may add/edit and remove stylesheets.

    Style Sheets are CSS files. This is where you can change the colours, fonts and font sizes throughout the board."; - $ADMIN->page_title = "Manage Stylesheets"; - - //+------------------------------- - - $SKIN->td_header[] = array( "Title" , "40%" ); - $SKIN->td_header[] = array( "Allocation" , "30%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - //+------------------------------- - - $DB->query("SELECT DISTINCT(c.cssid), c.css_name, s.sname from ibf_css c, ibf_skins s WHERE s.css_id=c.cssid ORDER BY c.css_name ASC"); - - $used_ids = array(); - - if ( $DB->get_num_rows() ) - { - - $ADMIN->html .= $SKIN->start_table( "Current Stylesheets In Use" ); - - while ( $r = $DB->fetch_row() ) - { - - $show_array[ $r['cssid'] ] .= stripslashes($r['sname'])."
    "; - - if ( in_array( $r['cssid'], $used_ids ) ) - { - continue; - } - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['css_name'])."", - "<#X-{$r['cssid']}#>", - "
    Export
    ", - "
    Edit
    ", - "Deallocate before removing", - ) ); - - $used_ids[] = $r['cssid']; - - $form_array[] = array( $r['cssid'], $r['css_name'] ); - - } - - foreach( $show_array as $idx => $string ) - { - $string = preg_replace( "/
    $/", "", $string ); - - $ADMIN->html = preg_replace( "/<#X-$idx#>/", "$string", $ADMIN->html ); - } - - $ADMIN->html .= $SKIN->end_table(); - } - - if ( count($used_ids) > 0 ) - { - - $DB->query("SELECT cssid, css_name FROM ibf_css WHERE cssid NOT IN(".implode(",",$used_ids).")"); - - if ( $DB->get_num_rows() ) - { - - $SKIN->td_header[] = array( "Title" , "70%" ); - $SKIN->td_header[] = array( "Export" , "10%" ); - $SKIN->td_header[] = array( "Edit" , "10%" ); - $SKIN->td_header[] = array( "Remove" , "10%" ); - - $ADMIN->html .= $SKIN->start_table( "Current Unallocated Stylesheets" ); - - $ADMIN->html .= $SKIN->js_checkdelete(); - - - while ( $r = $DB->fetch_row() ) - { - - $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['css_name'])."", - "
    Export
    ", - "
    Edit
    ", - "
    Remove
    ", - ) ); - - $form_array[] = array( $r['cssid'], $r['css_name'] ); - - } - - $ADMIN->html .= $SKIN->end_table(); - } - } - - //+------------------------------- - //+------------------------------- - - $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), - 2 => array( 'act' , 'style' ), - ) ); - - $SKIN->td_header[] = array( " " , "40%" ); - $SKIN->td_header[] = array( " " , "60%" ); - - $ADMIN->html .= $SKIN->start_table( "Create New Stylesheet" ); - - //+------------------------------- - - $ADMIN->html .= $SKIN->add_td_row( array( "Base new stylesheet on..." , - $SKIN->form_dropdown( "id", $form_array) - ) ); - - $ADMIN->html .= $SKIN->end_form("Create new stylesheet"); - - $ADMIN->html .= $SKIN->end_table(); - - //+------------------------------- - //+------------------------------- - - $ADMIN->output(); - - } - - -} - - + CSS management functions +| > Module written by Matt Mecham +| > Date started: 4th April 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new ad_settings(); + + +class ad_settings { + + var $base_url; + + function ad_settings() { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + switch($IN['code']) + { + case 'wrapper': + $this->list_sheets(); + break; + + case 'add': + $this->do_form('add'); + break; + + case 'edit2': + $this->do_form('edit'); + break; + + case 'edit': + //$this->edit_splash(); + $this->do_form('edit'); + break; + //break; + + case 'doadd': + $this->save_wrapper('add'); + break; + + case 'doedit': + $this->save_wrapper('edit'); + break; + + case 'remove': + $this->remove(); + break; + + case 'export': + $this->export(); + break; + + case 'optimize': + $this->optimize(); + break; + + case 'css_upload': + $this->css_upload('new'); + break; + + case 'easyedit': + $this->easy_edit(); + break; + + case 'editcomments': + $this->edit_comments(); + break; + + case 'doeditcomments': + $this->do_edit_comments(); + break; + + //------------------------- + default: + $this->list_sheets(); + break; + } + + } + + //+------------------------------- + + + + //+------------------------------- + + function do_edit_comments() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT cssid, css_text, css_name, css_comments FROM ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $cssinfo = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the CSS details from the database"); + } + + $DB->query("UPDATE ibf_css SET css_comments='{$IN['comments']}' WHERE cssid='".$IN['id']."'"); + + $ADMIN->done_screen("Comments Updated", "Manage Style Sheets", "act=style" ); + } + + //+------------------------------- + + function edit_comments() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT cssid, css_text, css_name, css_comments FROM ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $cssinfo = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the CSS details from the database"); + } + + //+------------------------------- + + $ADMIN->page_detail = "Please enter or edit the comments below"; + $ADMIN->page_title = "Edit Comments for Style Sheet '{$cssinfo['css_name']}'"; + + //+------------------------------- + + $SKIN->td_header[] = array( "CSS" , "40%" ); + $SKIN->td_header[] = array( "Comment" , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'doeditcomments' ), + 2 => array( 'act' , 'style' ), + 3 => array( 'id' , $IN['id'] ), + ) ); + + $ADMIN->html .= $SKIN->start_table( "Edit Comments" ); + + + $ADMIN->html .= $SKIN->add_td_row( array( + "Edit the comments for this stylesheet", + $SKIN->form_textarea( "comments", str_replace("
    ", "\n", $cssinfo['comments']) ) + ) ); + + $ADMIN->html .= $SKIN->add_td_basic("Back to: Manage Style Sheets -> Edit Options", "center", "title"); + + $ADMIN->html .= $SKIN->end_form("Edit the comments"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + //------------------------------------------------------------- + // ADD / EDIT WRAPPERS + //------------------------------------------------------------- + + function edit_splash() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT cssid, css_text, css_name FROM ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $cssinfo = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the CSS details from the database"); + } + + //+------------------------------- + + $ADMIN->page_detail = "Please select your editing option."; + $ADMIN->page_title = "Edit Style Sheet '{$cssinfo['css_name']}'"; + + + //+------------------------------- + + $SKIN->td_header[] = array( "Option" , "40%" ); + $SKIN->td_header[] = array( "Description" , "60%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Choose an option" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "CSS Editing", + "Edit the stylesheet as a complete resource in a similar environment as a text editor", + ) ); + + + $ADMIN->html .= $SKIN->add_td_row( array( + "Upload a stylesheet", + "Upload a stylesheet from your hard drive to replace the one stored in the database", + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Edit Comments", + "Edit the comments that indicate where the CSS definitions are used in the templates", + ) ); + + + $ADMIN->html .= $SKIN->add_td_basic("Back to: Manage Style Sheets", "center", "title"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + } + + + function css_upload($type='new') + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_FILES; + + $FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name']; + $FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size']; + $FILE_TYPE = $HTTP_POST_FILES['FILE_UPLOAD']['type']; + + // Naughty Opera adds the filename on the end of the + // mime type - we don't want this. + + $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); + + if (! is_dir($INFO['upload_dir']) ) + { + $ADMIN->error("Could not locate the uploads directory - make sure the 'uploads' path is set correctly"); + } + + // Naughty Mozilla likes to use "none" to indicate an empty upload field. + // I love universal languages that aren't universal. + + if ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "" or !$HTTP_POST_FILES['FILE_UPLOAD']['name'] or ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "none") ) + { + $ADMIN->error("No file was chosen to upload!"); + } + + //------------------------------------------------- + // Move the uploaded file to somewhere we can + // manipulate it in safe mode + //------------------------------------------------- + + if (! @move_uploaded_file( $HTTP_POST_FILES['FILE_UPLOAD']['tmp_name'], $INFO['upload_dir']."/".$FILE_NAME) ) + { + $ADMIN->error("The upload failed"); + } + + // Open the file and copy to the DB + + $real_name = str_replace( "_", " ", preg_replace( "/^(.*),\d+\.css$/", "\\1", $FILE_NAME ) ); + $real_name .= ' [UPLOAD]'; + + if ( $FH = @fopen( $INFO['upload_dir']."/".$FILE_NAME, "r" ) ) + { + $data = @fread( $FH, @filesize($INFO['upload_dir']."/".$FILE_NAME) ); + @fclose($FH); + @unlink($INFO['upload_dir']."/".$FILE_NAME); + } + else + { + @unlink($INFO['upload_dir']."/".$FILE_NAME); + $ADMIN->error("Could not open the uploaded file for reading, aborting process"); + } + + list($css, $comments) = explode( "<|COMMENTS|>", $data ); + + $css = trim($css); + $comments = trim($css); + + if ($type == 'new') + { + $dbs = $DB->compile_db_insert_string( array ( + 'css_name' => $real_name, + 'css_text' => $css, + 'css_comments' => $comments, + ) ); + + $DB->query("INSERT INTO ibf_css (".$dbs['FIELD_NAMES'].") VALUES(".$dbs['FIELD_VALUES'].")"); + $ADMIN->done_screen("Stylesheet uploaded", "Manage Style Sheets", "act=style" ); + } + + + } + + + //---------------------------------------------------- + + function optimize() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing CSS ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $orig_size = strlen($row['css_text']); + + $orig_text = str_replace( "\r\n", "\n", $row['css_text']); + $orig_text = str_replace( "\r" , "\n", $orig_text); + $orig_text = str_replace( "\n\n", "\n", $orig_text); + + $parsed = array(); + + // Remove comments + + $orig_text = preg_replace( "#/\*(.+?)\*/#s", "", $orig_text ); + + // Grab all the definitions + + preg_match_all( "/(.+?)\{(.+?)\}/s", $orig_text, $match, PREG_PATTERN_ORDER ); + + for ( $i = 0 ; $i < count($match[0]); $i++ ) + { + $match[1][$i] = trim($match[1][$i]); + $parsed[ $match[1][$i] ] = trim($match[2][$i]); + } + + //------------------ + + if ( count($parsed) < 1) + { + $ADMIN->error("The stylesheet is in a format that Invision Board cannot understand, no optimization done."); + } + + // Clean them up + + $final = ""; + + foreach( $parsed as $name => $p ) + { + // Ignore comments + + if ( preg_match( "#^//#", $name) ) + { + continue; + } + + // Split up the components + + $parts = explode( ";", $p); + $defs = array(); + + foreach( $parts as $part ) + { + if ($part != "") + { + list($definition, $data) = explode( ":", $part ); + $defs[] = trim($definition).": ".trim($data); + } + } + + $final .= $name . " { ".implode("; ", $defs). " }\n"; + } + + $final_size = strlen($final); + + if ($final_size < 1000) + { + $ADMIN->error("The stylesheet is in a format that Invision Board cannot understand, no optimization done."); + } + + // Update the DB + + $dbs = $DB->compile_db_update_string( array( 'css_text' => $final ) ); + + $DB->query("UPDATE ibf_css SET $dbs WHERE cssid='".$IN['id']."'"); + + $saved = $orig_size - $final_size; + $pc_saved = 0; + + if ($saved > 0) + { + $pc_saved = sprintf( "%.2f", ($saved / $orig_size) * 100); + } + + $ADMIN->done_screen("Stylesheet updated
    Characters Saved: $saved ($pc_saved %)", "Manage Style Sheets", "act=style" ); + + + + } + + + //---------------------------------------------------- + + function export() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing CSS ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $name = str_replace( " ", "_", $row['css_name'] ); + + @header("Content-type: unknown/unknown"); + @header("Content-Disposition: attachment; filename=$name,{$row['cssid']}.css"); + + print $row['css_text']; + + exit(); + + } + + + //------------------------------------------------------------- + // REMOVE WRAPPERS + //------------------------------------------------------------- + + function remove() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing stylesheet ID, go back and try again"); + } + + $DB->query("DELETE FROM ibf_css WHERE cssid='".$IN['id']."'"); + + $std->boink_it($SKIN->base_url."&act=style"); + + exit(); + + + } + + + + //------------------------------------------------------------- + // ADD / EDIT WRAPPERS + //------------------------------------------------------------- + + function save_wrapper( $type='add' ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + //+------------------------------- + + if ($type == 'edit') + { + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing CSS ID, go back and try again"); + } + + } + + if ($IN['name'] == "") + { + $ADMIN->error("You must specify a name for this stylesheet"); + } + + if ($IN['css'] == "") + { + $ADMIN->error("You can't have an empty stylesheet, can you?"); + } + + $css = stripslashes($HTTP_POST_VARS['css']); + + $barney = array( 'css_name' => stripslashes($HTTP_POST_VARS['name']), + 'css_text' => $css, + ); + + if ($type == 'add') + { + $db_string = $DB->compile_db_insert_string( $barney ); + + $DB->query("INSERT INTO ibf_css (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + $new_id = $DB->get_insert_id(); + + $std->boink_it($SKIN->base_url."&act=style"); + + exit(); + + } + else + { + $db_string = $DB->compile_db_update_string( $barney ); + + $DB->query("UPDATE ibf_css SET $db_string WHERE cssid='".$IN['id']."'"); + + $ADMIN->nav[] = array( 'act=style' ,'Style Sheet Control Home' ); + $ADMIN->nav[] = array( "act=style&code=edit2&id={$IN['id']}" ,"Edit Sheet Again" ); + + $ADMIN->done_screen("Stylesheet updated", "Manage Style Sheets", "act=style" ); + + + } + + + } + + //------------------------------------------------------------- + // ADD / EDIT WRAPPERS + //------------------------------------------------------------- + + function do_form( $type='add' ) + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + //+------------------------------- + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing wrapper ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT cssid, css_text, css_name FROM ibf_css WHERE cssid='".$IN['id']."'"); + + if ( ! $cssinfo = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the CSS details from the database"); + } + + //+------------------------------- + + $css = $cssinfo['css_text']; + + if ($type == 'add') + { + $code = 'doadd'; + $button = 'Create StyleSheet'; + $cssinfo['css_name'] = $cssinfo['css_name'].".2"; + } + else + { + $code = 'doedit'; + $button = 'Edit Stylesheet'; + } + + //+------------------------------- + // Start the CSS matcher thingy + //+------------------------------- + + //.class { definitions } + //#id { definitions } + + $css_elements = array(); + + preg_match_all( "/(\.|\#)(\S+?)\s{0,}\{.+?\}/s", $css, $match ); + + for ($i=0; $i < count($match[0]); $i++) + { + $type = trim($match[1][$i]); + + $name = trim($match[2][$i]); + + if ($type == '.') + { + $css_elements[] = array( 'class|'.$name, $type.$name ); + } + else + { + $css_elements[] = array( 'id|'.$name, $type.$name ); + } + } + + //+------------------------------- + + $ADMIN->page_detail = "You may use CSS fully when adding or editing stylesheets."; + $ADMIN->page_title = "Manage Style Sheets"; + + //+------------------------------- + + $ADMIN->html .= ""; + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'css_search' ), + 2 => array( 'act' , 'style' ), + 3 => array( 'id' , $IN['id'] ), + ), "cssForm" ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "80%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( "Find CSS Usage" ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Show me where...", + $SKIN->form_dropdown('csschoice', $css_elements).' ... is used within the templates  ' + .'' + .' ' + ) ); + + + + $ADMIN->html .= $SKIN->end_form(); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->js_no_specialchars(); + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , $code ), + 2 => array( 'act' , 'style' ), + 3 => array( 'id' , $IN['id'] ), + ), "theAdminForm", "onSubmit=\"return no_specialchars('csssheet')\"" ); + + //+------------------------------- + + $SKIN->td_header[] = array( " " , "20%" ); + $SKIN->td_header[] = array( " " , "80%" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->start_table( $button ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Stylesheet Title", + $SKIN->form_input('name', $cssinfo['css_name']), + ) ); + + $ADMIN->html .= $SKIN->add_td_row( array( + "Content

    (Launch Style Maker)", + $SKIN->form_textarea('css', $css, "70", "30"), + ) ); + + $ADMIN->html .= $SKIN->end_form($button); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->output(); + + + } + + //------------------------------------------------------------- + // SHOW STYLE SHEETS + //------------------------------------------------------------- + + function list_sheets() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; + + $form_array = array(); + $show_array = array(); + + $ADMIN->page_detail = "You may add/edit and remove stylesheets.

    Style Sheets are CSS files. This is where you can change the colours, fonts and font sizes throughout the board."; + $ADMIN->page_title = "Manage Stylesheets"; + + //+------------------------------- + + $SKIN->td_header[] = array( "Title" , "40%" ); + $SKIN->td_header[] = array( "Allocation" , "20%" ); + $SKIN->td_header[] = array( "Optimize" , "10%" ); + $SKIN->td_header[] = array( "Download" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + //+------------------------------- + + $DB->query("SELECT DISTINCT(c.cssid), c.css_name, s.sname from ibf_css c, ibf_skins s WHERE s.css_id=c.cssid ORDER BY c.css_name ASC"); + + $used_ids = array(); + + if ( $DB->get_num_rows() ) + { + + $ADMIN->html .= $SKIN->start_table( "Current Stylesheets In Use" ); + + while ( $r = $DB->fetch_row() ) + { + + $show_array[ $r['cssid'] ] .= stripslashes($r['sname'])."
    "; + + if ( in_array( $r['cssid'], $used_ids ) ) + { + continue; + } + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['css_name'])."", + "<#X-{$r['cssid']}#>", + "
    Optimize
    ", + "
    Download
    ", + "
    Edit
    ", + "Deallocate before removing", + ) ); + + $used_ids[] = $r['cssid']; + + $form_array[] = array( $r['cssid'], $r['css_name'] ); + + } + + foreach( $show_array as $idx => $string ) + { + $string = preg_replace( "/
    $/", "", $string ); + + $ADMIN->html = preg_replace( "/<#X-$idx#>/", "$string", $ADMIN->html ); + } + + $ADMIN->html .= $SKIN->end_table(); + } + + if ( count($used_ids) > 0 ) + { + + $DB->query("SELECT cssid, css_name FROM ibf_css WHERE cssid NOT IN(".implode(",",$used_ids).")"); + + if ( $DB->get_num_rows() ) + { + + $SKIN->td_header[] = array( "Title" , "60%" ); + $SKIN->td_header[] = array( "Optimize" , "10%" ); + $SKIN->td_header[] = array( "Download" , "10%" ); + $SKIN->td_header[] = array( "Edit" , "10%" ); + $SKIN->td_header[] = array( "Remove" , "10%" ); + + $ADMIN->html .= $SKIN->start_table( "Current Unallocated Stylesheets" ); + + $ADMIN->html .= $SKIN->js_checkdelete(); + + + while ( $r = $DB->fetch_row() ) + { + + $ADMIN->html .= $SKIN->add_td_row( array( "".stripslashes($r['css_name'])."", + "
    Optimize
    ", + "
    Download
    ", + "
    Edit
    ", + "
    Remove
    ", + ) ); + + $form_array[] = array( $r['cssid'], $r['css_name'] ); + + } + + $ADMIN->html .= $SKIN->end_table(); + } + } + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'add' ), + 2 => array( 'act' , 'style' ), + ) ); + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Create New Stylesheet (Copy)" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Base new stylesheet on..." , + $SKIN->form_dropdown( "id", $form_array) + ) ); + + $ADMIN->html .= $SKIN->end_form("Copy to new stylesheet"); + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'css_upload' ), + 2 => array( 'act' , 'style' ), + 3 => array( 'MAX_FILE_SIZE', '10000000000' ), + ) , "uploadform", " enctype='multipart/form-data'" ); + + + $SKIN->td_header[] = array( " " , "40%" ); + $SKIN->td_header[] = array( " " , "60%" ); + + $ADMIN->html .= $SKIN->start_table( "Upload new stylesheet" ); + + //+------------------------------- + + $ADMIN->html .= $SKIN->add_td_row( array( "Browse your hard drive" , + $SKIN->form_upload() + ) ); + + $ADMIN->html .= $SKIN->end_form("Upload new stylesheet"); + + $ADMIN->html .= $SKIN->end_table(); + + $ADMIN->output(); + + } + + +} + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/ad_templates.php b/upload/sources/Admin/ad_templates.php index b84da90b..475cbe27 100644 --- a/upload/sources/Admin/ad_templates.php +++ b/upload/sources/Admin/ad_templates.php @@ -1,1558 +1,1924 @@ - Skin -> Templates functions -| > Module written by Matt Mecham -| > Date started: 15th April 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - - - -$idx = new ad_settings(); - - -class ad_settings { - - var $base_url; - - function ad_settings() { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - switch($IN['code']) - { - case 'add': - $this->add_templates(); - break; - - case 'edit': - $this->do_form('edit'); - break; - - case 'edit2': - $this->show_file(); - break; - - case 'doedit': - $this->do_edit(); - break; - - case 'remove': - $this->remove(); - break; - - case 'tools': - $this->tools(); - break; - - case 'editinfo': - $this->edit_info(); - break; - - case 'export': - $this->export(); - break; - - //------------------------- - default: - $this->list_current(); - break; - } - - } - - function export() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing template set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $archive_dir = $INFO['base_dir']."/archive_out"; - $templates_dir = $INFO['base_dir']."/style_templates/".$row['skid']; - - require $root_dir."sources/lib/tar.php"; - - if (!is_dir($archive_dir)) - { - $ADMIN->error("Could not locate $archive_dir, is the directory there?"); - } - - if (!is_writeable($archive_dir)) - { - $ADMIN->error("Cannot write in $archive_dir, CHMOD via FTP to 0755 or 0777 to enable this script to write into it. IBF cannot do this for you"); - } - - if (!is_dir($templates_dir)) - { - $ADMIN->error("Could not locate $templates_dir, is the directory there?"); - } - - //+------------------------------- - // Attempt to copy the files to the - // working directory... - //+------------------------------- - - $l_name = preg_replace( "/\s{1,}/", "_", $row['skname'] ); - - $new_dir = "tmpl-".$l_name; - - if ( ! $ADMIN->copy_dir($templates_dir, $archive_dir."/".$new_dir) ) - { - $ADMIN->error( $ADMIN->errors ); - } - - // Generate the config file.. - - $file_content = " \"".addslashes($row['author'])."\", ". - "'email'=>\"".addslashes($row['email'])."\", ". - "'url'=>\"".addslashes($row['url'])."\")\n\n?".">"; - - $FH = fopen($archive_dir."/".$new_dir."/"."conf.inc", 'w'); - fwrite($FH, $file_content, strlen($file_content)); - fclose($FH); - - // Add files and write tarball - - $tar = new tar(); - - $tar->new_tar( $archive_dir, $new_dir.".tar" ); - $tar->add_directory( $archive_dir."/".$new_dir ); - $tar->write_tar(); - - // Check for errors. - - if ($tar->error != "") - { - $ADMIN->error($tar->error); - } - - // remove original unarchived directory - - $ADMIN->rm_dir($archive_dir."/".$new_dir); - - $ADMIN->done_screen("Template Pack Export Created

    You can download the tar-chive here", "Manage Template Sets", "act=templ" ); - - - } - - //+-------------------------------------------------------------------------------- - //+-------------------------------------------------------------------------------- - - function tools_rebuildphp() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing template set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - $templates_dir = $root_path."style_templates/".$IN['id']; - - $skin_dir = $root_path."Skin/s".$IN['id']; - - $errors = array(); - - $flag = 0; - - if (! file_exists( $root_path."style_templates/".$IN['id']."/config.php" ) ) - { - $ADMIN->error("Could not locate the template set configuration file, make sure 'config.php' resides in the templates directory you are editing. If - it is not there, you can copy one from another directory."); - } - - //+------------------------------- - - require $root_path."style_templates/".$IN['id']."/config.php"; - - //+------------------------------- - - - if ( ! is_writeable($skin_dir) ) - { - $ADMIN->error("Cannot write into '$skin_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if ( ! is_writeable($templates_dir) ) - { - $ADMIN->error("Cannot write into '$templates_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if ( is_dir($templates_dir) ) - { - if ( $handle = opendir($templates_dir) ) - { - - while (($filename = readdir($handle)) !== false) - { - if (($filename != ".") && ($filename != "..")) - { - if ( preg_match( "/^index\./", $filename ) ) - { - continue; - } - - //------------------------------------------- - - if ( preg_match( "/\.html$/", $filename ) ) - { - - $name = preg_replace( "/\.html$/", "", $filename ); - - if ( file_exists($skin_dir."/".$name.".php") ) - { - if (! is_writeable($skin_dir."/".$name.".php") ) - { - $errors[] = "Cannot write to $name".".php, skipping file..."; - continue; - } - } - - if ($FHD = fopen($templates_dir."/".$filename, 'r') ) - { - $text = fread($FHD, filesize($templates_dir."/".$filename) ); - fclose($FHD); - } - else - { - $errors[] = "Could not open $filename, skipping file..."; - continue; - } - - //---------------------------------------------------- - - $need = count($skin[$name]); - $start = 0; - $end = 0; - - if ($need < 1) - { - $errors[] = "Error recalling function data for $filename, skipping..."; - continue; - } - - // check to make sure the splitter tags are intact - - foreach($skin[$name] as $func_name => $data) - { - if ( preg_match("//", $text) ) - { - $start++; - } - - //+------------------------------- - - if ( preg_match("//", $text) ) - { - $end++; - } - } - - if ($start != $end) - { - $errors[] = "Some start or end template splitter comments are missing in $filename, skipping file...."; - continue; - } - - if ($start != $need) - { - $errors[] = "Some template splitter comments are missing in $filename, skipping file..."; - continue; - } - - //+------------------------------- - // Convert the tags back to php native - //+------------------------------- - - $text = $this->unconvert_tags($text); - - //+------------------------------- - // Start parsing the php skin file - //+------------------------------- - - $final = "<"."?php\n\n". - "class $name {\n\n"; - - foreach($skin[$name] as $func_name => $data) - { - - $top = "\n\nfunction $func_name($data) {\n". - "global \$ibforums;\n". - "return <<\s*\n/", "$top", $text); - - - //+------------------------------- - - $text = preg_replace("/\s*\s*\n/", "$bum", $text); - } - - $end = "\n\n}\n?".">"; - - $final .= $text.$end; - - if ($fh = fopen( $skin_dir."/".$name.".php", 'w' ) ) - { - fwrite($fh, $final, strlen($final) ); - fclose($fh); - } - else - { - $errors[] = "Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."; - } - - $end = ""; - $final = ""; - $top = ""; - - } // if *.php - - } // if not dir - - } // while loop - - closedir($handle); - - } - else - { - $errors[] = "Could not open directory $templates_dir for reading!"; - } - } - else - { - $errors[] = "$templates_dir is not a directory, please check the \$root_path variable in admin.php"; - } - - if (count($errors > 0)) - { - $ADMIN->html .= $SKIN->start_table("Errors and warnings"); - - $ADMIN->html .= $SKIN->add_td_basic( implode("
    ", $errors) ); - - $ADMIN->html .= $SKIN->end_table(); - } - - $ADMIN->done_screen("Source PHP Skin files updated from the editable templates", "Manage Template sets", "act=templ" ); - - - } - - - - function edit_info() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing template set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - $final['skname'] = stripslashes($HTTP_POST_VARS['skname']); - - if (isset($HTTP_POST_VARS['author'])) - { - $final['author'] = stripslashes($HTTP_POST_VARS['author']); - $final['email'] = stripslashes($HTTP_POST_VARS['email']); - $final['url'] = stripslashes($HTTP_POST_VARS['url']); - } - - $db_string = $DB->compile_db_update_string( $final ); - - $DB->query("UPDATE ibf_tmpl_names SET $db_string WHERE skid='".$IN['id']."'"); - - $ADMIN->done_screen("Template information updated", "Manage Template sets", "act=templ" ); - - } - - //+------------------------------- - //+------------------------------- - - function do_edit() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - $text = stripslashes($HTTP_POST_VARS['template']); - - if ($IN['id'] == "") - { - $ADMIN->error("You must specify an existing template set ID, go back and try again"); - } - - //+------------------------------- - - $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$IN['id']."'"); - - if ( ! $row = $DB->fetch_row() ) - { - $ADMIN->error("Could not query the information from the database"); - } - - //+------------------------------- - - $real_name = preg_replace( "/\.html/", "", $IN['name'] ); - - //+------------------------------- - - $template = $root_path."style_templates/".$IN['id']."/".$IN['name']; - $phpskin = $root_path."Skin/s".$IN['id']."/".$real_name.".php"; - - //+------------------------------- - - if (! file_exists( $root_path."style_templates/".$IN['id']."/config.php" ) ) - { - $ADMIN->error("Could not locate the template set configuration file, make sure 'config.php' resides in the templates directory you are editing. If - it is not there, you can copy one from another directory."); - } - - //+------------------------------- - - require $root_path."style_templates/".$IN['id']."/config.php"; - - //+------------------------------- - - if ( ! is_writeable($template) ) - { - $ADMIN->error("Cannot write into '$template', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if ( ! is_writeable($phpskin) ) - { - $ADMIN->error("Cannot write into '$phpskin', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - //+------------------------------- - // Ok, make sure we actually have - // some info to parse here. - //+------------------------------- - - if ($text == "") - { - $ADMIN->error("You can't delete the template in this manner"); - } - - //+------------------------------- - // Swop back < and > - //+------------------------------- - - $text = preg_replace("/</", "<", $text); - $text = preg_replace("/>/", ">", $text); - $text = preg_replace("/&/", "&", $text); - - //+------------------------------- - // Convert \r to nowt - //+------------------------------- - - $text = preg_replace("/\r/", "", $text); - - //+------------------------------- - // Make sure we have enough subs - // left. Check to make sure we've - // not removed and start and end tags - //+------------------------------- - - $start = 0; - $end = 0; - - $need = count($skin[$real_name]); - - // - - // check to make sure the splitter tags are intact - - foreach($skin[$real_name] as $func_name => $data) - { - if ( preg_match("//", $text) ) - { - $start++; - } - - //+------------------------------- - - if ( preg_match("//", $text) ) - { - $end++; - } - } - - if ($start != $end) - { - $ADMIN->error("Some start or end template splitter comments are missing, please go back and try again"); - } - - if ($start != $need) - { - $ADMIN->error("Some template splitter comments are missing, please go back and try again"); - } - - //+------------------------------- - // Save the template back to disk - //+------------------------------- - - if ($fh = fopen( "$template", 'w' ) ) - { - fwrite( $fh, $text, strlen($text) ); - fclose($fh); - } - else - { - $ADMIN->error("Could not save information to $template, please ensure that the CHMOD permissions are correct."); - } - - //+------------------------------- - // Convert the tags back to php native - //+------------------------------- - - $text = $this->unconvert_tags($text); - - //+------------------------------- - // Start parsing the php skin file - //+------------------------------- - - $final = "<"."?php\n\n". - "class $real_name {\n\n"; - - foreach($skin[$real_name] as $func_name => $data) - { - - $top = "\n\nfunction $func_name($data) {\n". - "global \$ibforums;\n". - "return <<\s*\n/", "$top", $text); - - - //+------------------------------- - - $text = preg_replace("/\s*\s*\n/", "$bum", $text); - } - - $end = "\n\n}\n?".">"; - - $final .= $text.$end; - - if ($fh = fopen( "$phpskin", 'w' ) ) - { - fwrite($fh, $final, strlen($final) ); - fclose($fh); - } - else - { - $ADMIN->error("Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."); - } - - $ADMIN->done_screen("Template file updated", "Manage Templates in template set: {$row['skname']}", "act=templ&code=edit&id={$IN['id']}" ); - - } - - //------------------------------------------------------------------------------------ - //------------------------------------------------------------------------------------ - - function tools() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - if ($IN['id'] == "") - { - $ADMIN->error("You must choose a valid skin file to perform this operation on"); - } - - if ($IN['tool'] == 'conf') - { - $this->tools_conf(); - } - else if ($IN['tool'] == 'tmpl') - { - $this->tools_build_tmpl(); - } - else - { - $this->tools_rebuildphp(); - } - - } - - //------------------------------------------------------------------------------------ - - function tools_build_tmpl() - { - global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; - - // Rebuilds the skin.html editable files from the PHP source files - - $templates_dir = $root_path."style_templates/".$IN['id']; - - $skin_dir = $root_path."Skin/s".$IN['id']; - - $errors = array(); - - $flag = 0; - - - if ( ! is_writeable($skin_dir) ) - { - $ADMIN->error("Cannot write into '$skin_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if ( ! is_writeable($templates_dir) ) - { - $ADMIN->error("Cannot write into '$templates_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); - } - - if ( is_dir($skin_dir) ) - { - if ( $handle = opendir($skin_dir) ) - { - - while (($filename = readdir($handle)) !== false) - { - if (($filename != ".") && ($filename != "..")) - { - - if ( preg_match( "/\.php$/", $filename ) ) - { - - $name = preg_replace( "/^(\S+)\.(\S+)$/", "\\1", $filename ); - - if ( file_exists($templates_dir."/".$name.".html") ) - { - if (! is_writeable($templates_dir."/".$name.".html") ) - { - $errors[] = "Cannot write to $name".".html, skipping file..."; - } - } - - $farray = file($skin_dir."/".$filename) or die("Could not open $skin_dir/$filename for reading"); - - //$tfh = fopen($skin_dir."/".$filename , 'r') - - //---------------------------------------------------- - - $functions = array(); - - foreach($farray as $f) - { - - // Skip javascript functions... - - if ( preg_match( "/"; + + $ADMIN->html .= $SKIN->start_table("Template: ".$row['skname']); + + while ( $group = $DB->fetch_row($all_cats) ) + { + + $name = "".$group['group_name'].""; + $desc = ""; + + $expand = 'Expand to Edit'; + $eid = $group['suid']; + $exp_content = ""; + + if ( isset($skin_names[ $group['group_name'] ]) ) + { + $name = "".$skin_names[ $group['group_name'] ][0].""; + $desc = "
    ".$skin_names[ $group['group_name'] ][1]; + } + else + { + $name .= " (Non-Default Group)"; + $desc = "
    This group is not part of the standard Invision Board installation and no description is available"; + } + + if ($IN['expand'] == $group['suid']) + { + $expand = 'Collapse'; + $eid = ''; + + $new_q = $DB->query("SELECT func_name, LENGTH(section_content) as sec_length, suid FROM ibf_skin_templates WHERE set_id='{$IN['id']}' AND group_name='{$group['group_name']}'"); + + //---------------------------- + + if ( $DB->get_num_rows($new_q) ) + { + $exp_content .= $SKIN->add_td_basic( " + + + + + + + + + +
    $name 
    # CharactersEditPreview Options
    ", "left", "tdrow2" ); + + + $temp = ""; + + while ( $sec = $DB->fetch_row($new_q) ) + { + $temp .= " + + {$sec['func_name']} + {$sec['sec_length']} + Edit + (HTML | Text | With CSS) + + "; + } + + $exp_content = str_replace( "", $temp, $exp_content ); + + $desc = ""; + + } + + //---------------------------- + + } + else + { + + $ADMIN->html .= $SKIN->add_td_row( array( + "".$name."".$desc, + "
    $expand
    ", + "
    Download | Upload
    ", + "
    ".$group['number_secs']."
    ", + ) ); + } + + $ADMIN->html .= $exp_content; + + } + + $ADMIN->html .= $SKIN->end_table(); + + //+------------------------------- + //+------------------------------- + + $ADMIN->nav[] = array( 'act=templ' ,'Template Control Home' ); + $ADMIN->nav[] = array( '' ,'Managing Template Set "'.$row['skname'].'"' ); + + $ADMIN->output(); + + + } + + + //+-------------------------------------------------------------------------------- + //+-------------------------------------------------------------------------------- + + + function edit_info() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + //+------------------------------- + + $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$IN['id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + $final['skname'] = stripslashes($HTTP_POST_VARS['skname']); + + if (isset($HTTP_POST_VARS['author'])) + { + $final['author'] = str_replace( ",", "", stripslashes($HTTP_POST_VARS['author']) ); + $final['email'] = str_replace( ",", "", stripslashes($HTTP_POST_VARS['email']) ); + $final['url'] = str_replace( ",", "", stripslashes($HTTP_POST_VARS['url']) ); + } + + $db_string = $DB->compile_db_update_string( $final ); + + $DB->query("UPDATE ibf_tmpl_names SET $db_string WHERE skid='".$IN['id']."'"); + + $ADMIN->done_screen("Template information updated", "Manage Template sets", "act=templ" ); + + } + + //+------------------------------- + //+------------------------------- + + function do_edit() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + $text = stripslashes($HTTP_POST_VARS['template']); + + if ($IN['suid'] == "") + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + //+------------------------------- + // Get the group name, etc + //+------------------------------- + + $DB->query("SELECT * FROM ibf_skin_templates WHERE suid='".$IN['suid']."'"); + + if ( ! $template = $DB->fetch_row() ) + { + $ADMIN->error("You must specify an existing template set ID, go back and try again"); + } + + $real_name = $template['group_name']; + + //+------------------------------- + // Get the template set info + //+------------------------------- + + $DB->query("SELECT * from ibf_tmpl_names WHERE skid='".$template['set_id']."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $ADMIN->error("Could not query the information from the database"); + } + + //+------------------------------- + + $phpskin = $root_path."Skin/s".$template['set_id']."/".$real_name.".php"; + + //+------------------------------- + + + if ($INFO['safe_mode_skins'] != 1) + { + + if (SAFE_MODE_ON == 1) + { + $ADMIN->error("Safe mode detected, you will need to change the board configuration to switch 'Safe Mode Skins' on. To do this, click on the 'Board Settings' menu and choose 'Basic Config' when the sub menu appears."); + } + + if ( ! is_writeable($phpskin) ) + { + $ADMIN->error("Cannot write into '$phpskin', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + + } + + //+------------------------------- + // Ok, make sure we actually have + // some info to parse here. + //+------------------------------- + + if ($text == "") + { + $ADMIN->error("You can't delete the template in this manner"); + } + + //+------------------------------- + // Swop back < and > + //+------------------------------- + + $text = preg_replace("/</", "<", $text); + $text = preg_replace("/>/", ">", $text); + $text = preg_replace("/&/", "&", $text); + + //+------------------------------- + // Convert \r to nowt + //+------------------------------- + + $text = preg_replace("/\r/", "", $text); + + $text = $this->unconvert_tags($text); + + //+------------------------------- + //Update the DB + //+------------------------------- + + $string = $DB->compile_db_update_string( array ( 'section_content' => $text ) ); + + $DB->query("UPDATE ibf_skin_templates SET $string WHERE suid='".$IN['suid']."'"); + + + //+------------------------------- + // Start parsing the php skin file + //+------------------------------- + + $final = "<"."?php\n\n". + "class $real_name {\n\n"; + + //+------------------------------------------ + // Get all the data from the DB that matches + // the group name (filename) and set_id + //+------------------------------------------ + + if ($INFO['safe_mode_skins'] != 1) + { + + if (SAFE_MODE_ON == 1) + { + $ADMIN->error("Safe mode detected, you will need to change the board configuration to switch 'Safe Mode Skins' on. To do this, click on the 'Board Settings' menu and choose 'Basic Config' when the sub menu appears."); + } + + $DB->query("SELECT * FROM ibf_skin_templates WHERE group_name='$real_name' AND set_id='{$template['set_id']}'"); + + while ( $data = $DB->fetch_row() ) + { + + $final .= "\n\nfunction {$data['func_name']}({$data['func_data']}) {\n". + "global \$ibforums;\n". + "return <<"; + + if ($fh = fopen( "$phpskin", 'w' ) ) + { + fwrite($fh, $final, strlen($final) ); + fclose($fh); + } + else + { + $ADMIN->error("Could not save information to $phpskin, please ensure that the CHMOD permissions are correct."); + } + + } + + $ADMIN->done_screen("Template file updated", "Manage Templates in template set: {$row['skname']}", "act=templ&code=edit&id={$template['set_id']}" ); + + } + + //------------------------------------------------------------------------------------ + //------------------------------------------------------------------------------------ + + function tools() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + if ($IN['id'] == "") + { + $ADMIN->error("You must choose a valid skin file to perform this operation on"); + } + + if ($IN['tool'] == 'tmpl') + { + $this->tools_build_tmpl(); + } + else + { + $this->tools_rebuildphp(); + } + + } + + //------------------------------------------------------------------------------------ + + function tools_build_tmpl() + { + global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS; + + $insert = 1; + + // Rebuilds the data editable files from the PHP source files + + $skin_dir = $root_path."Skin/s".$IN['id']; + + $curr_groups = array(); + + // Are we updating or inserting? + + $DB->query("SELECT group_name, func_name FROM ibf_skin_templates WHERE set_id='".$IN['id']."'"); + + if ( $DB->get_num_rows() ) + { + $insert = 0; + + while ( $gname = $DB->fetch_row() ) + { + $curr_group[ $gname['group_name'] ][ $gname['func_name'] ] = 1; + } + } + + $errors = array(); + + $flag = 0; + + //------------------------------------------------ + // Is this a safe mode only skinny poos? + //------------------------------------------------ + + if ( ! file_exists( $skin_dir ) ) + { + $ADMIN->error("This template set is a safe mode only skin and no PHP skin files exist, there is no need to run this tool on this template set."); + } + + + if ( ! is_readable($skin_dir) ) + { + $ADMIN->error("Cannot write into '$skin_dir', please check the CHMOD value, and if needed, CHMOD to 0777 via FTP. IBF cannot do this for you."); + } + + if ( is_dir($skin_dir) ) + { + if ( $handle = opendir($skin_dir) ) + { + + while (($filename = readdir($handle)) !== false) + { + if (($filename != ".") && ($filename != "..")) + { + + if ( preg_match( "/\.php$/", $filename ) ) + { + + $name = preg_replace( "/^(\S+)\.(\S+)$/", "\\1", $filename ); + + if ($FH = fopen($skin_dir."/".$filename, 'r') ) + { + $fdata = fread( $FH, filesize($skin_dir."/".$filename) ); + fclose($FH); + } + else + { + $errors[] = "Could not open $filename for reading, skipping file..."; + continue; + } + + $fdata = str_replace( "\r", "\n", $fdata ); + $fdata = str_replace( "\n\n", "\n", $fdata ); + + if ( ! preg_match( "/\n/", $fdata ) ) + { + $errors[] = "Could not find any line endings in $filename, skipping file..."; + continue; + } + + $farray = explode( "\n", $fdata ); + + //---------------------------------------------------- + + $functions = array(); + + foreach($farray as $f) + { + + // Skip javascript functions... + + if ( preg_match( "/ - "; - } - - - - function js_no_specialchars() - { - return " - - "; - } - - - //+-------------------------------------------------------------------- - //+-------------------------------------------------------------------- - // FORM ELEMENTS - //+-------------------------------------------------------------------- - //+-------------------------------------------------------------------- - - function start_form($hiddens="", $name='theAdminForm', $js="") { - global $IN, $INFO; - - $form = "
    - "; - - if (is_array($hiddens)) - { - foreach ($hiddens as $k => $v) { - $form .= "\n"; - } - } - - return $form; - - } - - //+-------------------------------------------------------------------- - - function form_hidden($hiddens="") { - - if (is_array($hiddens)) - { - foreach ($hiddens as $k => $v) { - $form .= "\n"; - } - } - - return $form; - } - - - //+-------------------------------------------------------------------- - - function end_form($text = "", $js = "") - { - // If we have text, we print another row of TD elements with a submit button - - $html = ""; - $colspan = ""; - - if ($text != "") - { - if ($this->td_colspan > 0) - { - $colspan = " colspan='".$this->td_colspan."' "; - } - - $html .= "\n"; - } - - $html .= "
    "; - - return $html; - - } - - //+-------------------------------------------------------------------- - - function form_input($name, $value="", $type='text', $js="") { - - if ($js != "") - { - $js = ' '.$js.' '; - } - - return ""; - - } - - //+-------------------------------------------------------------------- - - function form_textarea($name, $value="", $cols='60', $rows='5', $wrap='soft') { - - return ""; - - } - - //+-------------------------------------------------------------------- - - function form_dropdown($name, $list=array(), $default_val="", $js="") { - - if ($js != "") - { - $js = ' '.$js.' '; - } - - $html = "\n\n"; - - return $html; - - - } - - //+-------------------------------------------------------------------- - - function form_yes_no( $name, $default_val="" ) { - - $yes = "Yes   "; - $no = "   No"; - - - if ($default_val == 1) - { - $yes = "Yes   "; - } - else - { - $no = "   No"; - } - - - return $yes.'   '.$no; - - } - - //+-------------------------------------------------------------------- - - function build_group_perms( $read='*', $write='*', $reply='*' ) { - global $DB; - - - $html = " - - - - "; - - - - $html .= " - - - - - - - - \n"; - - //+------------------------------------------------------------------------- - - if ($read == '*') - { - $html .= "\n"; - } - else - { - $html .= "\n"; - } - - //+------------------------------------------------------------------------- - - if ($reply == '*') - { - $html .= "\n"; - } - else - { - $html .= "\n"; - } - - //+------------------------------------------------------------------------- - - if ($write == '*') - { - $html .= "\n"; - } - else - { - $html .= "\n"; - } - - //+------------------------------------------------------------------------- - - - $html .= " - - - - \n"; - - $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title ASC"); - - - while ( $data = $DB->fetch_row() ) - { - - $html .= " - \n"; - - if ($read == '*') - { - $html .= ""; - } - else if ( preg_match( "/(^|,)".$data['g_id']."(,|$)/", $read ) ) - { - $html .= ""; - } - else - { - $html .= ""; - } - - //+---------------------------------------------------------------------------------------- - - if ($reply == '*') - { - $html .= ""; - } - else if ( preg_match( "/(?:^|,)".$data['g_id']."(?:,|$)/", $reply ) ) - { - $html .= ""; - } - else - { - $html .= ""; - } - - //+---------------------------------------------------------------------------------------- - - if ($write == '*') - { - $html .= ""; - } - else if ( preg_match( "/(?:^|,)".$data['g_id']."(?:,|$)/", $write ) ) - { - $html .= ""; - } - else - { - $html .= ""; - } - - $html .= "\n\n"; - } - - $html .= "
    Member GroupRead TopicsReply to TopicsStart Topics
    ALL MEMBER GROUPS
    (current and future)

    OR adjust the member groups individually below
     
    {$data['g_title']}Read Read Read Reply Reply Reply Start Start Start 
     
    \n\n"; - - return $html; - - } - - - //+-------------------------------------------------------------------- - //+-------------------------------------------------------------------- - // SCREEN ELEMENTS - //+-------------------------------------------------------------------- - //+-------------------------------------------------------------------- - - function add_subtitle($title="",$id="subtitle", $colspan="") { - - if ($colspan != "") - { - $colspan = " colspan='$colspan' "; - } - - return "\n$title\n"; - - } - - //+-------------------------------------------------------------------- - - function start_table( $title="") { - - - if ($title != "") - { - $this->has_title = 1; - $html .= " - • $title - - - - "; - } - - - - $html .= " -
    - - -
    - "; - - - if (isset($this->td_header[0])) - { - $html .= "\n"; - - foreach ($this->td_header as $td) - { - if ($td[1] != "") - { - $width = " width='{$td[1]}' "; - } - else - { - $width = ""; - } - - $html .= "\n"; - - $this->td_colspan++; - } - - $html.= "\n"; - } - - return $html; - - } - - //+-------------------------------------------------------------------- - - - function add_td_row( $array, $css="" ) { - - if (is_array($array)) - { - $html = "\n"; - - $count = count($array); - - $this->td_colspan = $count; - - for ($i = 0; $i < $count ; $i++ ) - { - - $td_col = $i % 2 ? 'tdrow2' : 'tdrow1'; - - if ($css != "") - { - $td_col = $css; - } - - if (is_array($array[$i])) - { - $text = $array[$i][0]; - $colspan = $array[$i][1]; - - $html .= "\n"; - } - else - { - $html .= "\n"; - } - } - - $html .= "\n"; - - return $html; - } - - } - - //+-------------------------------------------------------------------- - - function add_td_basic($text="",$align="left",$id="tdrow1") { - - $html = ""; - $colspan = ""; - - if ($text != "") - { - if ($this->td_colspan > 0) - { - $colspan = " colspan='".$this->td_colspan."' "; - } - - - $html .= "\n"; - } - - return $html; - - } - - //+-------------------------------------------------------------------- - - function add_td_spacer() { - - if ($this->td_colspan > 0) - { - $colspan = " colspan='".$this->td_colspan."' "; - } - - return ""; - - } - - - - //+-------------------------------------------------------------------- - - function end_table() { - - $this->td_header = array(); // Reset TD headers - - if ($this->has_title == 1) - { - $this->has_title = 0; - - return "
    {$td[0]}
    ".$text."".$array[$i]."
    $text
    "; - } - else - { - return ""; - } - - } - - - //+-------------------------------------------------------------------- - - - - - - //+-------------------------------------------------------------------- - //+-------------------------------------------------------------------- - - - - function print_top($title="",$desc="") { - - return " - Menu - - - - - - - - - - - -
    - - - - - - - -
    Invision Board Administration
    - - - - - - "; - - } - - //+-------------------------------------------------------------------- - - function print_foot() { - - return " - -
    $title
    $desc
     
    -
    -
    © 2002 Invision Board (www.invisionboard.com)
    - - "; - } - - - //+-------------------------------------------------------------------- - - - - - //{ background-color:#C2CFDF; font-weight:bold; font-size:12px; color:#000055 } - - - function menu_top() { - global $INFO; - - return " - Menu - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - -
    Administration Menu
    -
    - - Expand All | Reduce All -
    - ACP Home | Board Home -
    - - - - -
    "; - - } - - //+-------------------------------------------------------------------- - - function menu_foot() { - - return "
    -
    -
    - - "; - } - - - //+-------------------------------------------------------------------- - - - function menu_cat_expanded($name="", $links="", $id = "") { - global $IN; - - return " - - - - - $links -
    - - - - - -
      Collapse Category  $name
    -
    -
    "; - - - } - - //+-------------------------------------------------------------------- - - - function menu_cat_collapsed($name="", $id = "", $desc="") { - global $IN; - - return " - - - - - - -
    - - - - - -
      Expand Category  $name
    -
    $desc
    -
    "; - - } - - //+-------------------------------------------------------------------- - - function menu_cat_link($url="", $name="") { - - return "   $name"; - - } - - - //+-------------------------------------------------------------------- - - function frame_set() { - global $IN, $ibforums; - - $frames = " - Invision Board Administration Center - - - - - - - - "; - - return $frames; - - } - - -} - - - - - - + Admin HTML stuff library +| > Script written by Matt Mecham +| > Date started: 1st march 2002 +| ++-------------------------------------------------------------------------- +*/ + + +class admin_skin { + + var $base_url; + var $img_url; + var $has_title; + var $td_widths = array(); + var $td_header = array(); + var $td_colspan; + + function admin_skin() { + global $INFO, $IN; + + $this->base_url = $INFO['board_url']."/admin.".$INFO['php_ext']."?adsess=".$IN['AD_SESS']; + $this->img_url = $INFO['html_url'].'/sys-img'; + + } + + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + // Javascript elements + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + + function js_help_link($help="") + { + return "( base_url}&act=quickhelp&id=$help','Help','width=250,height=400,resizable=yes,scrollbars=yes');\">Quick Help )"; + + } + + function js_template_tools() + { + + return " + + "; + + } + + + function js_checkdelete() + { + + return " + + "; + } + + + + function js_no_specialchars() + { + return " + + "; + } + + + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + // FORM ELEMENTS + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + + function start_form($hiddens="", $name='theAdminForm', $js="") { + global $IN, $INFO; + + $form = "
    + "; + + if (is_array($hiddens)) + { + foreach ($hiddens as $k => $v) { + $form .= "\n"; + } + } + + return $form; + + } + + //+-------------------------------------------------------------------- + + function form_hidden($hiddens="") { + + if (is_array($hiddens)) + { + foreach ($hiddens as $k => $v) { + $form .= "\n"; + } + } + + return $form; + } + + + //+-------------------------------------------------------------------- + + function end_form($text = "", $js = "") + { + // If we have text, we print another row of TD elements with a submit button + + $html = ""; + $colspan = ""; + + if ($text != "") + { + if ($this->td_colspan > 0) + { + $colspan = " colspan='".$this->td_colspan."' "; + } + + $html .= "\n"; + } + + $html .= "
    "; + + return $html; + + } + + //+-------------------------------------------------------------------- + + function form_upload($name="FILE_UPLOAD", $js="") { + + if ($js != "") + { + $js = ' '.$js.' '; + } + + return ""; + + } + + //+-------------------------------------------------------------------- + + function form_input($name, $value="", $type='text', $js="") { + + if ($js != "") + { + $js = ' '.$js.' '; + } + + return ""; + + } + + function form_simple_input($name, $value="", $size='5') { + + return ""; + + } + + //+-------------------------------------------------------------------- + + function form_textarea($name, $value="", $cols='60', $rows='5', $wrap='soft') { + + return ""; + + } + + //+-------------------------------------------------------------------- + + function form_dropdown($name, $list=array(), $default_val="", $js="") { + + if ($js != "") + { + $js = ' '.$js.' '; + } + + $html = "\n\n"; + + return $html; + + + } + + //+-------------------------------------------------------------------- + + function form_yes_no( $name, $default_val="" ) { + + $yes = "Yes   "; + $no = "   No"; + + + if ($default_val == 1) + { + $yes = "Yes   "; + } + else + { + $no = "   No"; + } + + + return $yes.'   '.$no; + + } + + //+-------------------------------------------------------------------- + + function build_group_perms( $read='*', $write='*', $reply='*', $upload='*' ) { + global $DB; + + + $html = " + + + + "; + + + + $html .= " + + + + + + + + + \n"; + + //+------------------------------------------------------------------------- + + if ($read == '*') + { + $html .= "\n"; + } + else + { + $html .= "\n"; + } + + //+------------------------------------------------------------------------- + + if ($reply == '*') + { + $html .= "\n"; + } + else + { + $html .= "\n"; + } + + //+------------------------------------------------------------------------- + + if ($write == '*') + { + $html .= "\n"; + } + else + { + $html .= "\n"; + } + + if ($upload == '*') + { + $html .= "\n"; + } + else + { + $html .= "\n"; + } + + //+------------------------------------------------------------------------- + + + $html .= " + + + + \n"; + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title ASC"); + + + while ( $data = $DB->fetch_row() ) + { + + $html .= " + \n"; + + if ($read == '*') + { + $html .= ""; + } + else if ( preg_match( "/(^|,)".$data['g_id']."(,|$)/", $read ) ) + { + $html .= ""; + } + else + { + $html .= ""; + } + + //+---------------------------------------------------------------------------------------- + + if ($reply == '*') + { + $html .= ""; + } + else if ( preg_match( "/(?:^|,)".$data['g_id']."(?:,|$)/", $reply ) ) + { + $html .= ""; + } + else + { + $html .= ""; + } + + //+---------------------------------------------------------------------------------------- + + if ($write == '*') + { + $html .= ""; + } + else if ( preg_match( "/(?:^|,)".$data['g_id']."(?:,|$)/", $write ) ) + { + $html .= ""; + } + else + { + $html .= ""; + } + + //+---------------------------------------------------------------------------------------- + + if ($upload == '*') + { + $html .= ""; + } + else if ( preg_match( "/(?:^|,)".$data['g_id']."(?:,|$)/", $upload ) ) + { + $html .= ""; + } + else + { + $html .= ""; + } + + $html .= "\n\n"; + } + + $html .= "
    Member GroupRead TopicsReply to TopicsStart TopicsCan Upload
    ALL MEMBER GROUPS
    (current and future)

    OR adjust the member groups individually below
     
    {$data['g_title']} »Read Read Read Reply Reply Reply Start Start Start Upload Upload Upload 
     
    \n\n"; + + return $html; + + } + + + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + // SCREEN ELEMENTS + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + + function add_subtitle($title="",$id="subtitle", $colspan="") { + + if ($colspan != "") + { + $colspan = " colspan='$colspan' "; + } + + return "\n$title\n"; + + } + + //+-------------------------------------------------------------------- + + function start_table( $title="", $desc="") { + + if ($desc != "") + { + $desc = "
        $desc"; + } + + + if ($title != "") + { + $this->has_title = 1; + $html .= " + • $title $desc + + + + "; + } + + + + $html .= " +
    + + +
    + "; + + + if (isset($this->td_header[0])) + { + $html .= "\n"; + + foreach ($this->td_header as $td) + { + if ($td[1] != "") + { + $width = " width='{$td[1]}' "; + } + else + { + $width = ""; + } + + $html .= "\n"; + + $this->td_colspan++; + } + + $html.= "\n"; + } + + return $html; + + } + + //+-------------------------------------------------------------------- + + + function add_td_row( $array, $css="" ) { + + if (is_array($array)) + { + $html = "\n"; + + $count = count($array); + + $this->td_colspan = $count; + + for ($i = 0; $i < $count ; $i++ ) + { + + $td_col = $i % 2 ? 'tdrow2' : 'tdrow1'; + + if ($css != "") + { + $td_col = $css; + } + + if (is_array($array[$i])) + { + $text = $array[$i][0]; + $colspan = $array[$i][1]; + + $html .= "\n"; + } + else + { + $html .= "\n"; + } + } + + $html .= "\n"; + + return $html; + } + + } + + //+-------------------------------------------------------------------- + + function add_td_basic($text="",$align="left",$id="tdrow1") { + + $html = ""; + $colspan = ""; + + if ($text != "") + { + if ($this->td_colspan > 0) + { + $colspan = " colspan='".$this->td_colspan."' "; + } + + + $html .= "\n"; + } + + return $html; + + } + + //+-------------------------------------------------------------------- + + function add_td_spacer() { + + if ($this->td_colspan > 0) + { + $colspan = " colspan='".$this->td_colspan."' "; + } + + return ""; + + } + + + + //+-------------------------------------------------------------------- + + function end_table() { + + $this->td_header = array(); // Reset TD headers + + if ($this->has_title == 1) + { + $this->has_title = 0; + + return "
    {$td[0]}
    ".$text."".$array[$i]."
    $text
    "; + } + else + { + return ""; + } + + } + + + //+-------------------------------------------------------------------- + + + + + + //+-------------------------------------------------------------------- + //+-------------------------------------------------------------------- + + function get_css() + { + return ""; + } + + + + function print_top($title="",$desc="") { + + $css = $this->get_css(); + + return " + Menu + + + + $css + + + + + + +
    Invision Board Administration
    + + + + + +
    + + + + +
    + + + + + + + + "; + + } + + function wrap_nav($links) + { + return " + +
    $title
    $desc
     
    + + + + +
    $links
    + + "; + } + + //+-------------------------------------------------------------------- + + function print_foot() { + + return "
    +
    + + + © 2002 Invision Board (www.invisionboard.com) + + + "; + } + + + //+-------------------------------------------------------------------- + + + + + //{ background-color:#C2CFDF; font-weight:bold; font-size:12px; color:#000055 } + + + function menu_top() { + global $INFO; + + return " + Menu + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    Administration Menu
    +
    + + Expand All | Reduce All +
    + ACP Home | Board Home +
    + + + + +
    "; + + } + + //+-------------------------------------------------------------------- + + function menu_foot() { + + return "
    +
    +
    + + "; + } + + + //+-------------------------------------------------------------------- + + + function menu_cat_expanded($name="", $links="", $id = "") { + global $IN; + + return " + + + + + $links +
    + + + + + +
      Collapse Category  $name
    +
    +
    "; + + + } + + //+-------------------------------------------------------------------- + + + function menu_cat_collapsed($name="", $id = "", $desc="") { + global $IN; + + return " + + + + + + +
    + + + + + +
      Expand Category  $name
    +
    $desc
    +
    "; + + } + + //+-------------------------------------------------------------------- + + function menu_cat_link($url="", $name="") { + + return "   $name"; + + } + + + //+-------------------------------------------------------------------- + + function frame_set() { + global $IN, $ibforums; + + $frames = " + Invision Board Administration Center + + + + + "; + + return $frames; + + } + + +} + + + + + + ?> \ No newline at end of file diff --git a/upload/sources/Admin/skin_info.php b/upload/sources/Admin/skin_info.php new file mode 100644 index 00000000..e59fd2cd --- /dev/null +++ b/upload/sources/Admin/skin_info.php @@ -0,0 +1,109 @@ + array( + 'Board Index Sections', + 'Elements for the board index listing (shows you all the forums and is the first page you see when visiting the board) such as + forum link HTML, active user overview HTML, board statistics overview HTML, today\'s birthdays overview HTML', + ), + + 'skin_buddy' => array( + 'Browse Buddy Sections', + 'Elements for the browse buddy feature, including links and search boxes', + ), + 'skin_calendar'=> array( + 'Calendar Sections', + 'Elements for the calendar, including calendar view, view events', + ), + 'skin_emails' => array( + 'Member Contact Sections', + 'Elements from various contact methods, such as ICQ, AIM pager, email form and report post to moderator form', + ), + 'skin_forum' => array( + 'Forum Index Sections', + 'Elements for forum view (list all topics in forum). Includes forum log in window, forum rules', + ), + 'skin_global' => array( + 'Global HTML elements', + 'Various HTML elements such as board header, redirect page, error page', + ), + 'skin_help' => array( + 'Help Sections', + 'Elements for the help screen, including search boxes and view help files', + ), + 'skin_legends' => array( + 'Board Legends Sections', + 'Elements for the "view all emoticons" windows, and the "Find User" sections', + ), + 'skin_login' => array( + 'Log In Sections', + 'Elements for the log in form', + ), + 'skin_mlist' => array( + 'Member List Sections', + 'Elements for the member list views', + ), + 'skin_mod' => array( + 'Moderator Function Sections', + 'Elements for the moderator tools such as delete topic, edit topic and the moderator CP sections', + ), + 'skin_msg' => array( + 'Messenger Sections', + 'Elements for the messenger, such as view inbox, view message, archive messages, etc', + ), + 'skin_online' => array ( + 'Online List Sections', + 'Elements for the "Show all online users" link', + ), + 'skin_poll' => array ( + 'View Poll Sections', + 'Elements for the poll view, includes vote form and vote results', + ), + 'skin_post' => array( + 'Post Screen Sections', + 'Elements for the post screens such as new topic, reply to topic, quote post, edit post, some messenger new PM sections, some calender new event sections', + ), + 'skin_printpage'=> array( + 'Printable Topic Sections', + 'Elements for displaying the "printable topic" page', + ), + 'skin_profile' => array( + 'Profile View Sections', + 'Elements for viewing a members profile', + ), + 'skin_register' => array( + 'Register Sections', + 'Elements for the register form, validate account form and COPPA forms', + ), + 'skin_search' => array( + 'Search Sections', + 'Elements for the search forum and the results view', + ), + 'skin_stats' => array( + 'Statistics Section', + 'Elements for various functions such as "View Moderating Team", "View todays top 10 posts", "View Active Topics"', + ), + 'skin_topic' => array( + 'Topic View Section', + 'Elements for the topic view screen, such as post view, inline attachment view, etc.', + ), + + 'skin_modcp' => array( + 'Mod CP Section', + 'Elements for the moderators control panel sections.', + ), + + + 'skin_ucp' => array( + 'User Control Panel Section', + 'Elements for the user control panel, such as the menu (also used in Messenger Views), edit profile, edit signature, edit avatar, etc.', + ) +); + + + + + +?> \ No newline at end of file diff --git a/upload/sources/Boards.php b/upload/sources/Boards.php index c496e74f..dea89750 100644 --- a/upload/sources/Boards.php +++ b/upload/sources/Boards.php @@ -1,708 +1,775 @@ - Board index module -| > Module written by Matt Mecham -| > Date started: 17th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Boards; - -class Boards { - - var $output = ""; - var $base_url = ""; - var $html = ""; - var $output = ""; - var $forums = array(); - var $mods = array(); - var $cats = array(); - var $children = array(); - var $nav; - - var $news_topic_id = ""; - var $news_forum_id = ""; - var $news_title = ""; - - function Boards() { - global $ibforums, $DB, $std, $print, $skin_universal; - - require "./Skin/".$ibforums->skin_id."/skin_boards.php"; - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - // Get more words for this invocation! - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_boards', $ibforums->lang_id); - - $this->html = new skin_boards(); - - if (! $ibforums->member['id'] ) - { - $ibforums->input['last_visit'] = time(); - } - - $this->output .= $this->html->PageTop( $std->get_date( $ibforums->input['last_visit'], 'LONG' ) ); - - // Get the forums and category info from the DB - - $last_c_id = -1; - - $DB->query("SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc, ". - "c.image, c.url from ibf_forums f, ibf_categories c order by c.position, f.position"); - - - while ( $r = $DB->fetch_row() ) - { - if ($last_c_id != $r['cat_id']) - { - $this->cats[ $r['cat_id'] ] = array( 'id' => $r['cat_id'], - 'position' => $r['cat_position'], - 'state' => $r['cat_state'], - 'name' => $r['cat_name'], - 'description' => $r['cat_desc'], - 'image' => $r['image'], - 'url' => $r['url'], - ); - - $last_c_id = $r['cat_id']; - } - - if ($r['parent_id'] > 0) - { - $this->children[ $r['parent_id'] ][$r['id']] = $r; - } - else - { - $this->forums[ $r['id'] ] = $r; - } - } - - $DB->query("SELECT forum_id, member_name, member_id FROM ibf_moderators"); - - while ( $mod = $DB->fetch_row() ) - { - $this->mods[ $mod['forum_id'] ][] = array( 'name' => $mod['member_name'], - 'id' => $mod['member_id'], - ); - } - - //----------------------------------- - // What are we doing? - //----------------------------------- - - if ($ibforums->input['c'] != "") - { - $this->show_single_cat(); - $this->nav[] = $this->cats[ $ibforums->input['c'] ]['name']; - } - else if ($ibforums->input['sub'] == 1) - { - $this->show_subforum(); - $this->nav[] = $this->forums[ $ibforums->input['f'] ]['name']; - } - else - { - $this->process_all_cats(); - } - - //*********************************************/ - // Add in show online users - //*********************************************/ - - $active = array( 'TOTAL' => 0 , - 'NAMES' => "", - 'GUESTS' => 0 , - 'MEMBERS' => 0 , - 'ANON' => 0 , - ); - - $stats_html = ""; - - if ($ibforums->vars['show_active']) - { - - // Get the users from the DB - - $time = time() - 900; - - $DB->query("SELECT s.member_id, s.member_name, s.login_type, g.suffix, g.prefix FROM ibf_sessions s, ibf_groups g WHERE running_time > '$time' AND g.g_id=s.member_group ORDER BY running_time DESC"); - - // cache all printed members so we don't double print them - $cached = array(); - while ($result = $DB->fetch_row() ) - { - if ($result['member_id'] == 0) - { - $active['GUESTS']++; - } - else - { - if (empty( $cached[ $result['member_id'] ] ) ) - { - $cached[ $result['member_id'] ] = 1; - if ($result['login_type'] == 1) - { - $active['ANON']++; - } - else - { - $active['MEMBERS']++; - $active['NAMES'] .= " >vars['php_ext']}?s={$ibforums->session_id}&act=Profile&MID={$result['member_id']}'>{$result['prefix']}{$result['member_name']}{$result['suffix']}"; - } - } - - } - } - - $active['TOTAL'] = $active['MEMBERS'] + $active['GUESTS'] + $active['ANON']; - - // Show a link? - - if ($ibforums->vars['allow_online_list']) - { - $active['LINK'] = '[ '."".$ibforums->lang['browser_user_list']."".' ]'; - } - - $stats_html .= $this->html->ActiveUsers($active); - - - //----------------------------------------------- - // Are we viewing the calendar? - //----------------------------------------------- - - if ($ibforums->vars['show_birthdays']) - { - - $user_time = time() + ($ibforums->vars['TIME_ZONE'] * 3600) + ($ibforums->member['TIME_ADJUST'] * 3600 ); - - $date = getdate($user_time); - - $day = $date['mday']; - $month = $date['mon']; - $year = $date['year']; - - $birthstring = ""; - $count = 0; - - $DB->query("SELECT id, name, bday_day as DAY, bday_month as MONTH, bday_year as YEAR from ibf_members WHERE bday_day='$day' and bday_month='$month'"); - - while ($user = $DB->fetch_row()) - { - $birthstring .= ">{$user['name']} "; - if ($user['YEAR']) - { - $pyear = $year - $user['YEAR']; // $year = 2002 and $user['YEAR'] = 1976 - $birthstring .= "($pyear) "; - } - $count++; - } - - $lang = $ibforums->lang['no_birth_users']; - - if ($count > 0) { - $lang = ($count > 1) ? $ibforums->lang['birth_users'] : $ibforums->lang['birth_user']; - } - else - { - $count = ""; - } - - $stats_html .= $this->html->birthdays( $birthstring, $count, $lang ); - } - - } - - //*********************************************/ - // Add in show stats - //*********************************************/ - - - if ($ibforums->vars['show_totals']) - { - - $DB->query("SELECT * FROM ibf_stats"); - $stats = $DB->fetch_row(); - - // Update the most active count if needed - - if ($active['TOTAL'] > $stats['MOST_COUNT']) - { - $DB->query("UPDATE ibf_stats SET MOST_DATE='".time()."', MOST_COUNT='".$active[TOTAL]."'"); - $stats['MOST_COUNT'] = $active[TOTAL]; - $stats['MOST_DATE'] = time(); - } - - $most_time = $std->get_date( $stats['MOST_DATE'], 'LONG' ); - - $ibforums->lang['most_online'] = preg_replace( "/<#NUM#>/" , $stats['MOST_COUNT'] , $ibforums->lang['most_online'] ); - $ibforums->lang['most_online'] = preg_replace( "/<#DATE#>/", $most_time , $ibforums->lang['most_online'] ); - - $total_posts = $stats['TOTAL_REPLIES']+$stats['TOTAL_TOPICS']; - - $ibforums->lang['total_word_string'] = preg_replace( "/<#posts#>/" , "$total_posts" , $ibforums->lang['total_word_string'] ); - $ibforums->lang['total_word_string'] = preg_replace( "/<#reg#>/" , $stats['MEM_COUNT'] , $ibforums->lang['total_word_string'] ); - $ibforums->lang['total_word_string'] = preg_replace( "/<#mem#>/" , $stats['LAST_MEM_NAME'] , $ibforums->lang['total_word_string'] ); - - $stats_html .= $this->html->ShowStats($ibforums->lang['total_word_string']); - - } - - if ($stats_html != "") - { - $this->output .= $this->html->stats_header(); - $this->output .= $stats_html; - $this->output .= $this->html->stats_footer(); - } - - - // Add in board info footer - $this->output .= $this->html->BoardInformation(); - - // Check for news forum. - - if ($this->news_title and $this->news_topic_id and $this->news_forum_id) - { - $t_html = $this->html->newslink( $this->news_forum_id, stripslashes($this->news_title) , $this->news_topic_id); - $this->output = preg_replace( "//" , "$t_html" , $this->output ); - } - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." (Powered by Invision Board)", 'JS' => 0, 'NAV' => $this->nav ) ); - - } - - //*********************************************/ - // - // SHOW A SUB FORUM - // - //*********************************************/ - - function show_subforum() { - - global $std, $DB, $ibforums; - - $fid = $ibforums->input['f']; - - if (!is_array( $this->forums[ $fid ] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - - if ( (isset($this->children[ $fid ])) and (count($this->children[ $fid ]) > 0 ) ) - { - foreach ($this->children[ $fid ] as $idx => $data) - { - $temp_html .= $this->process_forum($data['id'], $data); - } - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - - if ($temp_html != "") - { - $this->output .= $this->html->subheader(); - $this->output .= $temp_html; - $this->output .= $this->html->end_this_cat(); - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - unset($temp_html); - - $this->output .= $this->html->end_all_cats(); - } - - - //*********************************************/ - // - // PROCESS ALL CATEGORIES - // - //*********************************************/ - - function process_all_cats() { - - global $std, $DB, $ibforums; - - foreach ($this->cats as $cat_id => $cat_data) - { - - //---------------------------- - // Is this category turned on? - //---------------------------- - - if (! $cat_data['state'] ) - { - continue; - } - - foreach ($this->forums as $forum_id => $forum_data) - { - if ($forum_data['category'] == $cat_id) - { - //----------------------------------- - // We store the HTML in a temp var so - // we can make sure we have cats for - // this forum, or hidden forums with a - // cat will show the cat strip - we don't - // want that, no - we don't. - //----------------------------------- - - $temp_html .= $this->process_forum($forum_id, $forum_data); - } - } - - if ($temp_html != "") - { - $this->output .= $this->html->CatHeader_Expanded($cat_data); - $this->output .= $temp_html; - $this->output .= $this->html->end_this_cat(); - } - - unset($temp_html); - } - - $this->output .= $this->html->end_all_cats(); - - } - - - //*********************************************/ - // - // SHOW A SINGLE CATEGORY - // - //*********************************************/ - - function show_single_cat() { - - global $std, $DB, $ibforums; - - $cat_id = $ibforums->input['c']; - - if (!is_array( $this->cats[ $cat_id ] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - - $cat_data = $this->cats[ $cat_id ]; - - //---------------------------- - // Is this category turned on? - //---------------------------- - - if (! $cat_data['state'] ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - - foreach ($this->forums as $forum_id => $forum_data) - { - if ($forum_data['category'] == $cat_id) - { - //----------------------------------- - // We store the HTML in a temp var so - // we can make sure we have cats for - // this forum, or hidden forums with a - // cat will show the cat strip - we don't - // want that, no - we don't. - //----------------------------------- - - $temp_html .= $this->process_forum($forum_id, $forum_data); - } - } - - if ($temp_html != "") - { - $this->output .= $this->html->CatHeader_Expanded($cat_data); - $this->output .= $temp_html; - $this->output .= $this->html->end_this_cat(); - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); - } - unset($temp_html); - - $this->output .= $this->html->end_all_cats(); - } - - //*********************************************/ - // - // RENDER A FORUM - // - //*********************************************/ - - function process_forum($forum_id="", $forum_data="") - { - global $std, $ibforums; - - - if ($forum_data['subwrap'] == 1) - { - - $printed_children = 0; - - //-------------------------------------- - // This is a sub cat forum... - //-------------------------------------- - - // Do we have any sub forums here? - - if ( (isset($this->children[ $forum_data['id'] ])) and (count($this->children[ $forum_data['id'] ]) > 0 ) ) - { - - $newest = array(); - - foreach($this->children[ $forum_data['id'] ] as $idx => $data) - { - //-------------------------------------- - // Check permissions... - //-------------------------------------- - - if ($data['read_perms'] != '*') - { - if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $data['read_perms'] ) ) - { - continue; - } - } - - // Do the news stuff first - - if (isset($data['last_title']) and $data['last_id'] != "") - { - - if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $data['id']) ) - { - - $this->news_topic_id = $data['last_id']; - $this->news_forum_id = $data['id']; - $this->news_title = $data['last_title']; - - } - - } - - if ($data['last_post'] > $newest['last_post']) - { - - $newest['last_post'] = $data['last_post']; - $newest['fid'] = $data['id']; - - if (strlen($data['last_title']) > 30) - { - $data['last_title'] = str_replace( "!" , "!", $data['last_title'] ); - $data['last_title'] = str_replace( """, "\"", $data['last_title'] ); - $data['last_title'] = substr($data['last_title'],0,27) . "..."; - $data['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $data['last_title'] ); - } - if ($data['password'] != "") - { - $newest['last_topic'] = $ibforums->lang['f_protected']; - } - else - { - $newest['last_topic'] = "vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$data['id']}&t={$data['last_id']}&view=getlastpost'>{$data['last_title']}"; - } - - if ( isset($data['last_poster_name'])) - { - $newest['last_poster'] = $data['last_poster_id'] ? "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$data['last_poster_id']}'>{$data['last_poster_name']}" - : $data['last_poster_name']; - } - - } - - $newest['posts'] += $data['posts']; - $newest['topics'] += $data['topics']; - $newest['status'] = $data['status']; - - $printed_children++; - - } - - if ($printed_children < 1) - { - // If we don't have permission to view any forums - // then simply return and the row won't be printed - - return ""; - - } - - // Fix up the last of the data - - $newest['img_new_post'] = $this->new_posts($newest, 1); - - $newest['last_post'] = $std->get_date($newest['last_post'], 'LONG'); - - $newest['last_topic'] = $newest['last_topic'] ? $newest['last_topic'] : $ibforums->lang['f_none']; - - $newest['last_poster'] = $newest['last_poster'] ? $newest['last_poster'] : $ibforums->lang['f_none']; - - foreach($newest as $k => $v) - { - $forum_data[$k] = $v; - } - - return $this->html->ForumRow($forum_data); - - } - else - { - return ""; - } - - } - else - { - - //-------------------------------------- - // Check permissions... - //-------------------------------------- - - if ($forum_data['read_perms'] != '*') - { - if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $forum_data['read_perms'] ) ) - { - return ""; - } - } - - $forum_data['img_new_post'] = $this->new_posts($forum_data); - - $forum_data['last_post'] = $std->get_date($forum_data['last_post'], 'LONG'); - - $forum_data['last_topic'] = $ibforums->lang['f_none']; - - if (isset($forum_data['last_title']) and $forum_data['last_id'] != "") - { - - if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $forum_data['id']) ) - { - - $this->news_topic_id = $forum_data['last_id']; - $this->news_forum_id = $forum_data['id']; - $this->news_title = $forum_data['last_title']; - - } - - $forum_data['last_title'] = str_replace( "!" , "!", $forum_data['last_title'] ); - $forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] ); - - - if (strlen($forum_data['last_title']) > 30) - { - $forum_data['last_title'] = substr($forum_data['last_title'],0,27) . "..."; - $forum_data['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $forum_data['last_title'] ); - } - - if ($forum_data['password'] != "") - { - $forum_data['last_topic'] = $ibforums->lang['f_protected']; - } - else - { - $forum_data['last_topic'] = "vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$forum_data['id']}&t={$forum_data['last_id']}&view=getlastpost'>{$forum_data['last_title']}"; - } - } - - if ( isset($forum_data['last_poster_name'])) - { - $forum_data['last_poster'] = $forum_data['last_poster_id'] ? "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}" - : $forum_data['last_poster_name']; - } - else - { - $forum_data['last_poster'] = $ibforums->lang['f_none']; - } - - //--------------------------------- - // Moderators - //--------------------------------- - - $forum_data['moderator'] = ""; - - if (isset($this->mods[ $forum_data['id'] ] ) ) - { - $forum_data['moderator'] = $ibforums->lang['forum_leader'].' '; - - if (is_array($this->mods[ $forum_data['id'] ]) ) - { - foreach ($this->mods[ $forum_data['id'] ] as $moderator) - { - $forum_data['moderator'] .= "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$moderator['id']}'>{$moderator['name']}, "; - } - $forum_data['moderator'] = preg_replace( "!,\s+$!", "", $forum_data['moderator'] ); - } - else - { - $forum_data['moderator'] .= "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$this->mods[$forum_data['id']]['id']}'>{$this->mods[$forum_data['id']]['name']}"; - } - } - - - return $this->html->ForumRow($forum_data); - - } - - } - - - function new_posts($forum_data, $sub=0) { - global $ibforums, $std; - - $rtime = $ibforums->input['last_visit']; - - $fid = $forum_data['fid'] == "" ? $forum_data['id'] : $forum_data['fid']; - - if ( $ftime = $std->my_getcookie('fread_'.$fid ) ) - { - $rtime = $ftime > $rtime ? $ftime : $rtime; - } - - if ($sub == 0) - { - if ( ! $forum_data['status'] ) - { - return $ibforums->skin['C_LOCKED']; - } - - $sub_cat_img = ''; - } - else - { - $sub_cat_img = '_CAT'; - } - - if ($forum_data['password'] and $sub == 0) - { - return $forum_data['last_post'] > $rtime ? $ibforums->skin['C_ON_RES'] - : $ibforums->skin['C_OFF_RES']; - } - - return $forum_data['last_post'] > $rtime ? $ibforums->skin['C_ON'.$sub_cat_img] - : $ibforums->skin['C_OFF'.$sub_cat_img]; - } - -} - -?> + Board index module +| > Module written by Matt Mecham +| > Date started: 17th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Boards; + +class Boards { + + var $output = ""; + var $base_url = ""; + var $html = ""; + var $output = ""; + var $forums = array(); + var $mods = array(); + var $cats = array(); + var $children = array(); + var $nav; + + var $news_topic_id = ""; + var $news_forum_id = ""; + var $news_title = ""; + + function Boards() { + global $ibforums, $DB, $std, $print, $skin_universal; + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + + // Get more words for this invocation! + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_boards', $ibforums->lang_id); + + $this->html = $std->load_template('skin_boards'); + + if (! $ibforums->member['id'] ) + { + $ibforums->input['last_visit'] = time(); + } + + $this->output .= $this->html->PageTop( $std->get_date( $ibforums->input['last_visit'], 'LONG' ) ); + + // Get the forums and category info from the DB + + $last_c_id = -1; + + $DB->query("SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc, + c.image, c.url, m.member_name as mod_name, m.member_id as mod_id, m.is_group, m.group_id, m.group_name, m.mid + from ibf_forums f, ibf_categories c + LEFT JOIN ibf_moderators m ON (f.id=m.forum_id) + order by c.position, f.position"); + + + while ( $r = $DB->fetch_row() ) + { + if ($last_c_id != $r['cat_id']) + { + $this->cats[ $r['cat_id'] ] = array( 'id' => $r['cat_id'], + 'position' => $r['cat_position'], + 'state' => $r['cat_state'], + 'name' => $r['cat_name'], + 'description' => $r['cat_desc'], + 'image' => $r['image'], + 'url' => $r['url'], + ); + + $last_c_id = $r['cat_id']; + } + + if ($r['parent_id'] > 0) + { + $this->children[ $r['parent_id'] ][$r['id']] = $r; + } + else + { + $this->forums[ $r['id'] ] = $r; + } + + if ($r['mod_id'] != "") + { + $this->mods[ $r['id'] ][ $r['mid'] ] = array( 'name' => $r['mod_name'], + 'id' => $r['mod_id'], + 'isg' => $r['is_group'], + 'gname'=> $r['group_name'], + 'gid' => $r['group_id'], + ); + } + } + + //----------------------------------- + // What are we doing? + //----------------------------------- + + if ($ibforums->input['c'] != "") + { + $this->show_single_cat(); + $this->nav[] = $this->cats[ $ibforums->input['c'] ]['name']; + } + else if ($ibforums->input['sub'] == 1) + { + $this->show_subforum(); + $this->nav[] = $this->forums[ $ibforums->input['f'] ]['name']; + } + else + { + $this->process_all_cats(); + } + + //*********************************************/ + // Add in show online users + //*********************************************/ + + $active = array( 'TOTAL' => 0 , + 'NAMES' => "", + 'GUESTS' => 0 , + 'MEMBERS' => 0 , + 'ANON' => 0 , + ); + + $stats_html = ""; + + if ($ibforums->vars['show_active']) + { + + if ($ibforums->vars['au_cutoff'] == "") + { + $ibforums->vars['au_cutoff'] = 15; + } + + // Get the users from the DB + + $cut_off = $ibforums->vars['au_cutoff'] * 60; + + $time = time() - $cut_off; + + $DB->query("SELECT s.member_id, s.member_name, s.login_type, g.suffix, g.prefix + FROM ibf_sessions s + LEFT JOIN ibf_groups g ON (g.g_id=s.member_group) + WHERE running_time > '$time' + ORDER BY s.running_time DESC"); + + // cache all printed members so we don't double print them + $cached = array(); + while ($result = $DB->fetch_row() ) + { + if ($result['member_id'] == 0) + { + $active['GUESTS']++; + } + else + { + if (empty( $cached[ $result['member_id'] ] ) ) + { + $cached[ $result['member_id'] ] = 1; + if ($result['login_type'] == 1) + { + if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_admin_anon'] != 1) ) + { + $active['NAMES'] .= " >{$result['prefix']}{$result['member_name']}{$result['suffix']}*"; + $active['ANON']++; + } + else + { + $active['anon']++; + } + } + else + { + $active['MEMBERS']++; + $active['NAMES'] .= " >vars['php_ext']}?s={$ibforums->session_id}&act=Profile&MID={$result['member_id']}'>{$result['prefix']}{$result['member_name']}{$result['suffix']}"; + } + } + } + } + + $active['TOTAL'] = $active['MEMBERS'] + $active['GUESTS'] + $active['ANON']; + + // Show a link? + + if ($ibforums->vars['allow_online_list']) + { + $active['LINK'] = '[ '."".$ibforums->lang['browser_user_list']."".' ]'; + } + + $ibforums->lang['active_users'] = sprintf( $ibforums->lang['active_users'], $ibforums->vars['au_cutoff'] ); + + $stats_html .= $this->html->ActiveUsers($active, $ibforums->vars['au_cutoff']); + + //----------------------------------------------- + // Are we viewing the calendar? + //----------------------------------------------- + + if ($ibforums->vars['show_birthdays']) + { + + $user_time = time() + ($ibforums->member['time_offset'] * 3600 ); + + $date = getdate($user_time); + + $day = $date['mday']; + $month = $date['mon']; + $year = $date['year']; + + $birthstring = ""; + $count = 0; + + $DB->query("SELECT id, name, bday_day as DAY, bday_month as MONTH, bday_year as YEAR from ibf_members WHERE bday_day='$day' and bday_month='$month'"); + + while ($user = $DB->fetch_row()) + { + $birthstring .= ">{$user['name']} "; + if ($user['YEAR']) + { + $pyear = $year - $user['YEAR']; // $year = 2002 and $user['YEAR'] = 1976 + $birthstring .= "($pyear) "; + } + $count++; + } + + $lang = $ibforums->lang['no_birth_users']; + + if ($count > 0) { + $lang = ($count > 1) ? $ibforums->lang['birth_users'] : $ibforums->lang['birth_user']; + } + else + { + $count = ""; + } + + $stats_html .= $this->html->birthdays( $birthstring, $count, $lang ); + } + + } + + //----------------------------------------------- + // Are we viewing the calendar? + //----------------------------------------------- + + if ($ibforums->vars['show_calendar']) + { + + if ($ibforums->vars['calendar_limit'] < 2) + { + $ibforums->vars['calendar_limit'] = 2; + } + + $our_unix = time() + ($ibforums->member['time_offset'] * 3600 ); + $max_date = $our_unix + ($ibforums->vars['calendar_limit'] * 86400); + + $DB->query("SELECT eventid, title, read_perms, priv_event, userid FROM ibf_calendar_events WHERE unix_stamp > '$our_unix' and unix_stamp < '$max_date' ORDER BY unix_stamp ASC"); + + $show_events = array(); + + while ($event = $DB->fetch_row()) + { + if ($event['priv_event'] == 1 and $ibforums->member['id'] != $event['userid']) + { + continue; + } + + //----------------------------------------- + // Do we have permission to see the event? + //----------------------------------------- + + if ( $event['read_perms'] != '*' ) + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) ) + { + continue; + } + } + + $show_events[] = "".$event['title'].""; + } + + if ( count($show_events) > 0 ) + { + $event_string = implode( ", ", $show_events ); + } + else + { + $event_string = $ibforums->lang['no_calendar_events']; + } + + $ibforums->lang['calender_f_title'] = sprintf( $ibforums->lang['calender_f_title'], $ibforums->vars['calendar_limit'] ); + + $stats_html .= $this->html->calendar_events( $event_string ); + } + + //*********************************************/ + // Add in show stats + //*********************************************/ + + + if ($ibforums->vars['show_totals']) + { + + $DB->query("SELECT * FROM ibf_stats"); + $stats = $DB->fetch_row(); + + // Update the most active count if needed + + if ($active['TOTAL'] > $stats['MOST_COUNT']) + { + $DB->query("UPDATE ibf_stats SET MOST_DATE='".time()."', MOST_COUNT='".$active[TOTAL]."'"); + $stats['MOST_COUNT'] = $active[TOTAL]; + $stats['MOST_DATE'] = time(); + } + + $most_time = $std->get_date( $stats['MOST_DATE'], 'LONG' ); + + $ibforums->lang['most_online'] = str_replace( "<#NUM#>" , $stats['MOST_COUNT'] , $ibforums->lang['most_online'] ); + $ibforums->lang['most_online'] = str_replace( "<#DATE#>", $most_time , $ibforums->lang['most_online'] ); + + $total_posts = $stats['TOTAL_REPLIES']+$stats['TOTAL_TOPICS']; + + $link = $ibforums->base_url."&act=Profile&MID=".$stats['LAST_MEM_ID']; + + $ibforums->lang['total_word_string'] = str_replace( "<#posts#>" , "$total_posts" , $ibforums->lang['total_word_string'] ); + $ibforums->lang['total_word_string'] = str_replace( "<#reg#>" , $stats['MEM_COUNT'] , $ibforums->lang['total_word_string'] ); + $ibforums->lang['total_word_string'] = str_replace( "<#mem#>" , $stats['LAST_MEM_NAME'] , $ibforums->lang['total_word_string'] ); + $ibforums->lang['total_word_string'] = str_replace( "<#link#>" , $link , $ibforums->lang['total_word_string'] ); + + $stats_html .= $this->html->ShowStats($ibforums->lang['total_word_string']); + + } + + if ($stats_html != "") + { + $this->output .= $this->html->stats_header(); + $this->output .= $stats_html; + $this->output .= $this->html->stats_footer(); + } + + + // Add in board info footer + $this->output .= $this->html->BoardInformation(); + + // Check for news forum. + + if ($this->news_title and $this->news_topic_id and $this->news_forum_id) + { + $t_html = $this->html->newslink( $this->news_forum_id, stripslashes($this->news_title) , $this->news_topic_id); + $this->output = str_replace( "" , "$t_html" , $this->output ); + } + + // Display quick log in if we're not a member + + if ($ibforums->member['id'] < 1) + { + $this->output = str_replace( "" , $this->html->quick_log_in() , $this->output ); + } + + $print->add_output("$this->output"); + + $cp = " (Powered by Invision Board)"; + + if ($ibforums->vars['ips_cp_purchase']) + { + $cp = ""; + } + + $print->do_output( array( 'TITLE' => $ibforums->vars['board_name'].$cp, 'JS' => 0, 'NAV' => $this->nav ) ); + + } + + //*********************************************/ + // + // SHOW A SUB FORUM + // + //*********************************************/ + + + //*********************************************/ + // + // PROCESS ALL CATEGORIES + // + //*********************************************/ + + function process_all_cats() { + + global $std, $DB, $ibforums; + + foreach ($this->cats as $cat_id => $cat_data) + { + + //---------------------------- + // Is this category turned on? + //---------------------------- + + if (! $cat_data['state'] ) + { + continue; + } + + foreach ($this->forums as $forum_id => $forum_data) + { + if ($forum_data['category'] == $cat_id) + { + //----------------------------------- + // We store the HTML in a temp var so + // we can make sure we have cats for + // this forum, or hidden forums with a + // cat will show the cat strip - we don't + // want that, no - we don't. + //----------------------------------- + + $temp_html .= $this->process_forum($forum_id, $forum_data); + } + } + + if ($temp_html != "") + { + $this->output .= $this->html->CatHeader_Expanded($cat_data); + $this->output .= $temp_html; + $this->output .= $this->html->end_this_cat(); + } + + unset($temp_html); + } + + $this->output .= $this->html->end_all_cats(); + + } + + + //*********************************************/ + // + // SHOW A SINGLE CATEGORY + // + //*********************************************/ + + function show_single_cat() { + + global $std, $DB, $ibforums; + + $cat_id = $ibforums->input['c']; + + if (!is_array( $this->cats[ $cat_id ] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); + } + + $cat_data = $this->cats[ $cat_id ]; + + //---------------------------- + // Is this category turned on? + //---------------------------- + + if (! $cat_data['state'] ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); + } + + foreach ($this->forums as $forum_id => $forum_data) + { + if ($forum_data['category'] == $cat_id) + { + //----------------------------------- + // We store the HTML in a temp var so + // we can make sure we have cats for + // this forum, or hidden forums with a + // cat will show the cat strip - we don't + // want that, no - we don't. + //----------------------------------- + + $temp_html .= $this->process_forum($forum_id, $forum_data); + } + } + + if ($temp_html != "") + { + $this->output .= $this->html->CatHeader_Expanded($cat_data); + $this->output .= $temp_html; + $this->output .= $this->html->end_this_cat(); + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) ); + } + unset($temp_html); + + $this->output .= $this->html->end_all_cats(); + } + + //*********************************************/ + // + // RENDER A FORUM + // + //*********************************************/ + + function process_forum($forum_id="", $forum_data="") + { + global $std, $ibforums; + + + if ($forum_data['subwrap'] == 1) + { + + $printed_children = 0; + + //-------------------------------------- + // This is a sub cat forum... + //-------------------------------------- + + // Do we have any sub forums here? + + if ( (isset($this->children[ $forum_data['id'] ])) and (count($this->children[ $forum_data['id'] ]) > 0 ) ) + { + + // Are we allowed to see the postable forum stuff? + + if ($forum_data['sub_can_post'] == 1) + { + if ($forum_data['read_perms'] == '*') + { + $forum_data['fid'] = $forum_data['id']; + $newest = $forum_data; + } + else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $forum_data['read_perms'] ) ) + { + $forum_data['fid'] = $forum_data['id']; + $newest = $forum_data; + } + else + { + $newest = array(); + } + } + + foreach($this->children[ $forum_data['id'] ] as $idx => $data) + { + //-------------------------------------- + // Check permissions... + //-------------------------------------- + + if ($data['read_perms'] != '*') + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $data['read_perms'] ) ) + { + continue; + } + } + + // Do the news stuff first + + if (isset($data['last_title']) and $data['last_id'] != "") + { + + if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $data['id']) ) + { + + $this->news_topic_id = $data['last_id']; + $this->news_forum_id = $data['id']; + $this->news_title = $data['last_title']; + + } + + } + + if ($data['last_post'] > $newest['last_post']) + { + + $newest['last_post'] = $data['last_post']; + $newest['fid'] = $data['id']; + //$newest['id'] = $data['id']; + $newest['last_id'] = $data['last_id']; + $newest['last_title'] = $data['last_title']; + $newest['password'] = $data['password']; + $newest['last_poster_id'] = $data['last_poster_id']; + $newest['last_poster_name'] = $data['last_poster_name']; + $newest['status'] = $data['status']; + } + + $newest['posts'] += $data['posts']; + $newest['topics'] += $data['topics']; + + $printed_children++; + + } + + if ($printed_children < 1) + { + // If we don't have permission to view any forums + // then simply return and the row won't be printed + + return ""; + + } + + // Fix up the last of the data + + if (strlen($newest['last_title']) > 30) + { + $newest['last_title'] = str_replace( "!" , "!" , $newest['last_title'] ); + $newest['last_title'] = str_replace( """, "\"", $newest['last_title'] ); + $newest['last_title'] = substr($newest['last_title'],0,27) . "..."; + $newest['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $newest['last_title'] ); + } + if ($newest['password'] != "") + { + $newest['last_topic'] = $ibforums->lang['f_protected']; + } + else if($newest['last_title'] != "") + { + $newest['last_topic'] = "vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$newest['fid']}&t={$newest['last_id']}&view=getlastpost'>{$newest['last_title']}"; + } + else + { + $newest['last_topic'] = $ibforums->lang['f_none']; + } + + if ( isset($newest['last_poster_name'])) + { + $newest['last_poster'] = $newest['last_poster_id'] ? "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$newest['last_poster_id']}'>{$newest['last_poster_name']}" + : $newest['last_poster_name']; + } + else + { + $newest['last_poster'] = $ibforums->lang['f_none']; + } + + $newest['img_new_post'] = $std->forum_new_posts($newest, 1); + + $newest['last_post'] = $std->get_date($newest['last_post'], 'LONG'); + + foreach($newest as $k => $v) + { + if ($k == 'id') + { + continue; + } + $forum_data[$k] = $v; + } + + + return $this->html->ForumRow($forum_data); + + } + else + { + return ""; + } + + } + else + { + + //-------------------------------------- + // Check permissions... + //-------------------------------------- + + if ($forum_data['read_perms'] != '*') + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $forum_data['read_perms'] ) ) + { + return ""; + } + } + + $forum_data['img_new_post'] = $std->forum_new_posts($forum_data); + + $forum_data['last_post'] = $std->get_date($forum_data['last_post'], 'LONG'); + + $forum_data['last_topic'] = $ibforums->lang['f_none']; + + if (isset($forum_data['last_title']) and $forum_data['last_id'] != "") + { + + if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $forum_data['id']) ) + { + + $this->news_topic_id = $forum_data['last_id']; + $this->news_forum_id = $forum_data['id']; + $this->news_title = $forum_data['last_title']; + + } + + $forum_data['last_title'] = str_replace( "!" , "!", $forum_data['last_title'] ); + $forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] ); + + if (strlen($forum_data['last_title']) > 30) + { + $forum_data['last_title'] = substr($forum_data['last_title'],0,27) . "..."; + $forum_data['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $forum_data['last_title'] ); + } + + if ($forum_data['password'] != "") + { + $forum_data['last_topic'] = $ibforums->lang['f_protected']; + } + else + { + $forum_data['last_topic'] = "vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$forum_data['id']}&t={$forum_data['last_id']}&view=getlastpost'>{$forum_data['last_title']}"; + } + } + + if ( isset($forum_data['last_poster_name'])) + { + $forum_data['last_poster'] = $forum_data['last_poster_id'] ? "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}" + : $forum_data['last_poster_name']; + } + else + { + $forum_data['last_poster'] = $ibforums->lang['f_none']; + } + + //--------------------------------- + // Moderators + //--------------------------------- + + $forum_data['moderator'] = ""; + + if (isset($this->mods[ $forum_data['id'] ] ) ) + { + $forum_data['moderator'] = $ibforums->lang['forum_leader'].' '; + + if (is_array($this->mods[ $forum_data['id'] ]) ) + { + foreach ($this->mods[ $forum_data['id'] ] as $moderator) + { + if ($moderator['isg'] == 1) + { + $forum_data['moderator'] .= "{$moderator['gname']}, "; + } + else + { + $forum_data['moderator'] .= "{$moderator['name']}, "; + } + } + + $forum_data['moderator'] = preg_replace( "!,\s+$!", "", $forum_data['moderator'] ); + + } + else + { + if ($moderator['isg'] == 1) + { + $forum_data['moderator'] .= "{$this->mods[$forum_data['id']]['gname']}, "; + } + else + { + $forum_data['moderator'] .= "{$this->mods[$forum_data['id']]['name']}"; + } + } + } + + + return $this->html->ForumRow($forum_data); + + } + + } + + +} + +?> diff --git a/upload/sources/Drivers/mySQL.php b/upload/sources/Drivers/mySQL.php index 3f862249..17d3eb59 100644 --- a/upload/sources/Drivers/mySQL.php +++ b/upload/sources/Drivers/mySQL.php @@ -2,10 +2,10 @@ /* +-------------------------------------------------------------------------- -| IBFORUMS v1 +| Invision Board v1.1 | ======================================== -| by Matthew Mecham and David Baxter -| (c) 2001,2002 IBForums +| by Matthew Mecham +| (c) 2001,2002 Invision Power Services | http://www.ibforums.com | ======================================== | Web: http://www.ibforums.com @@ -33,12 +33,15 @@ class db_driver { "persistent" => "0" , "sql_tbl_prefix" => "ibf_" , "cached_queries" => array(), + 'debug' => 0, ); var $query_id = ""; var $connection_id = ""; var $query_count = 0; var $record_row = array(); + var $return_die = 0; + var $error = ""; /*========================================================================*/ // Connect to the database @@ -74,7 +77,7 @@ class db_driver { /*========================================================================*/ function query($the_query) { - + //-------------------------------------- // Change the table prefix if needed //-------------------------------------- @@ -84,6 +87,13 @@ class db_driver { $the_query = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $this->obj['sql_tbl_prefix']."\\1\\2", $the_query); } + if ($this->obj['debug']) + { + global $Debug, $ibforums; + + $Debug->startTimer(); + } + $this->query_id = mysql_query($the_query, $this->connection_id); if (! $this->query_id ) @@ -91,7 +101,77 @@ class db_driver { $this->fatal_error("mySQL query error: $the_query"); } - $this->query_count++; + if ($this->obj['debug']) + { + $endtime = $Debug->endTimer(); + + if ( preg_match( "/^select/i", $the_query ) ) + { + $eid = mysql_query("EXPLAIN $the_query", $this->connection_id); + $ibforums->debug_html .= " + + + + + + + + + + + \n"; + while( $array = mysql_fetch_array($eid) ) + { + $type_col = '#FFFFFF'; + + if ($array['type'] == 'ref' or $array['type'] == 'eq_ref' or $array['type'] == 'const') + { + $type_col = '#D8FFD4'; + } + else if ($array['type'] == 'ALL') + { + $type_col = '#FFEEBA'; + } + + $ibforums->debug_html .= " + + + + + + + + + \n"; + } + + if ($endtime > 0.1) + { + $endtime = "$endtime"; + } + + $ibforums->debug_html .= " + + +
    Select Query
    $the_query
    tabletypepossible_keyskeykey_lenrefrowsExtra
    $array[table] $array[type] $array[possible_keys] $array[key] $array[key_len] $array[ref] $array[rows] $array[Extra] 
    mySQL time: $endtime
    \n
    \n"; + } + else + { + $ibforums->debug_html .= " + + + + + + + + + +
    Non Select Query
    $the_query
    mySQL time: $endtime

    \n\n"; + } + } + + $this->query_count++; $this->obj['cached_queries'][] = $the_query; @@ -167,7 +247,46 @@ class db_driver { function close_db() { return mysql_close($this->connection_id); - } + } + + /*========================================================================*/ + // Return an array of tables + /*========================================================================*/ + + function get_table_names() { + + $result = mysql_list_tables($this->obj['sql_database']); + $num_tables = @mysql_numrows($result); + for ($i = 0; $i < $num_tables; $i++) + { + $tables[] = mysql_tablename($result, $i); + } + + mysql_free_result($result); + + return $tables; + } + + /*========================================================================*/ + // Return an array of fields + /*========================================================================*/ + + function get_result_fields($query_id="") { + + if ($query_id == "") + { + $query_id = $this->query_id; + } + + while ($field = mysql_fetch_field($query_id)) + { + $Fields[] = $field; + } + + //mysql_free_result($query_id); + + return $Fields; + } /*========================================================================*/ // Basic error handler @@ -176,6 +295,15 @@ class db_driver { function fatal_error($the_error) { global $INFO; + + // Are we simply returning the error? + + if ($this->return_die == 1) + { + $this->error = mysql_error(); + return TRUE; + } + $the_error .= "\n\nmySQL error: ".mysql_error()."\n"; $the_error .= "mySQL error code: ".mysql_errno()."\n"; $the_error .= "Date: ".date("l dS of F Y h:i:s A"); @@ -206,6 +334,7 @@ class db_driver { foreach ($data as $k => $v) { $v = preg_replace( "/'/", "\\'", $v ); + //$v = preg_replace( "/#/", "\\#", $v ); $field_names .= "$k,"; $field_values .= "'$v',"; } diff --git a/upload/sources/Forums.php b/upload/sources/Forums.php index c73048f9..82960931 100644 --- a/upload/sources/Forums.php +++ b/upload/sources/Forums.php @@ -1,653 +1,928 @@ - Forum topic index module -| > Module written by Matt Mecham -| > Date started: 14th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Forums; - -class Forums { - - var $output = ""; - var $base_url = ""; - var $html = ""; - var $moderator = array(); - var $forum = array(); - var $show_dots = ""; - var $nav_extra = ""; - var $read_array = array(); - - //+---------------------------------------------------------------- - // - // Our constructor, load words, load skin, get DB forum/cat data - // - //+---------------------------------------------------------------- - - function Forums() { - global $ibforums, $DB, $std, $print, $skin_universal; - - require "./Skin/".$ibforums->skin_id."/skin_forum.php"; - - $ibforums->input['f'] = intval($ibforums->input['f']); - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_forum', $ibforums->lang_id); - - $this->html = new skin_forum(); - - - - // Get the forum info based on the forum ID, and get the category name, ID, etc. - - $DB->query("SELECT f.*, c.id as cat_id, c.name as cat_name from ibf_forums f, ibf_categories c WHERE f.id=".$ibforums->input['f']." and c.id=f.category"); - - $this->forum = $DB->fetch_row(); - - //---------------------------------------- - // Error out if we can not find the forum - //---------------------------------------- - - if (!$this->forum['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - - //---------------------------------------- - // If this is a sub forum, we need to get - // the cat details, and parent details - //---------------------------------------- - - if ($this->forum['parent_id'] > 0) - { - - $DB->query("SELECT f.id as forum_id, f.name as forum_name, c.id, c.name FROM ibf_forums f, ibf_categories c WHERE f.id='".$this->forum['parent_id']."' AND c.id=f.category"); - - $row = $DB->fetch_row(); - - $this->forum['cat_id'] = $row['id']; - $this->forum['cat_name'] = $row['name']; - - $this->nav_extra = "{$row['forum_name']}"; - } - - //---------------------------------------- - // - // If this is a sub forum, bounce back. - // - //---------------------------------------- - - if ($this->forum['subwrap'] == 1) - { - $std->boink_it($ibforums->base_url."&sub=1&f=".$this->forum['id']); - exit(); - } - - //-------------------------------------------------------------------------------- - //-------------------------------------------------------------------------------- - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - $this->forum['FORUM_JUMP'] = $std->build_forum_jump(); - $this->forum['FORUM_JUMP'] = preg_replace( "!#Forum Jump#!", $ibforums->lang['forum_jump'], $this->forum['FORUM_JUMP']); - - - - // Are we viewing the forum, or viewing the forum rules? - - if ($ibforums->input['act'] == 'SR') - { - $this->show_rules(); - } else { - $this->show_forum(); - } - - } - - //+---------------------------------------------------------------- - // - // Show the forum rules on a seperate page - // - //+---------------------------------------------------------------- - - function show_rules() { - global $DB, $ibforums, $std, $print; - - //+-------------------------------------------- - // Do we have permission to view these rules? - //+-------------------------------------------- - - $bad_entry = $this->check_access(); - - if ($bad_entry == 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_topic') ); - } - - //+-------------------------------------------- - // Get the rules from the DB - //+-------------------------------------------- - - $DB->query("SELECT * FROM ibf_rules WHERE fid='".$ibforums->input['f']."'"); - - if ( $rules = $DB->fetch_row() ) - { - $rules['title'] = stripslashes($rules['title']); - $rules['body'] = stripslashes($rules['body']); - - $this->output .= $this->html->show_rules($rules); - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => "IBForums -> ".$this->forum['name'], - 'JS' => 0, - 'NAV' => array( - "{$this->forum['cat_name']}", - ), - ) ); - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_topic') ); - } - } - - //+---------------------------------------------------------------- - // - // Forum view check for authentication - // - //+---------------------------------------------------------------- - - function show_forum() { - global $ibforums; - // are we checking for user authentication via the log in form - // for a private forum w/password protection? - - $ibforums->input['L'] == 1 ? $this->authenticate_user() : $this->render_forum(); - } - - //+---------------------------------------------------------------- - // - // Authenicate the log in for a password protected forum - // - //+---------------------------------------------------------------- - - function authenticate_user() { - global $std, $ibforums, $print; - - if ($ibforums->input['f_password'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) ); - } - - if ($ibforums->input['f_password'] != $this->forum['password']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'wrong_pass' ) ); - } - - $std->my_setcookie( "iBForum".$this->forum['id'], $ibforums->input['f_password'] ); - - $print->redirect_screen( $ibforums->lang['logged_in'] , "act=SF&f=".$this->forum['id'] ); - - } - - //+---------------------------------------------------------------------------------- - - function check_access() { - global $ibforums, $HTTP_COOKIE_VARS; - - $return = 1; - - if ($this->forum['read_perms'] == '*') - { - $return = 0; - } - else if (preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) ) - { - $return = 0; - } - - if ($this->forum['password']) - { - if ($HTTP_COOKIE_VARS[ $ibforums->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password']) - { - $return = 0; - } - else - { - $this->forum_login(); - } - } - - return $return; - - } - - //+---------------------------------------------------------------------------------- - - function forum_login() { - global $ibforums, $std, $DB, $HTTP_COOKIE_VARS, $print; - - if (empty($ibforums->member['id'])) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) ); - } - - $this->output = $this->html->Forum_log_in( $this->forum['id'] ); - - $print->add_output("$this->output"); - - $print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->forum['name'], - 'JS' => 0, - 'NAV' => array( - "{$this->forum['cat_name']}", - "{$this->forum['name']}", - ), - ) ); - - } - - //+---------------------------------------------------------------- - // - // Main render forum engine - // - //+---------------------------------------------------------------- - - function render_forum() { - global $ibforums, $DB, $std, $print, $HTTP_COOKIE_VARS; - - $bad_entry = $this->check_access(); - - if ($bad_entry == 1) - { - $std->Error( array( LEVEL => 1, MSG => 'no_permission') ); - } - - if ( $read = $std->my_getcookie('topicsread') ) - { - $this->read_array = unserialize(stripslashes($read)); - } - - if ( $forum = $std->my_getcookie('fread_'.$ibforums->input['f']) ) - { - $ibforums->input['last_visit'] = $forum > $ibforums->input['last_visit'] ? $forum : $ibforums->input['last_visit']; - } - - $prune_value = $std->select_var( array( - 1 => $ibforums->input['prune_day'], - 2 => $this->forum['prune'] , - 3 => '100' ) - ); - - $sort_key = $std->select_var( array( - 1 => $ibforums->input['sort_key'], - 2 => $this->forum['sort_key'] , - 3 => 'last_post' ) - ); - - $sort_by = $std->select_var( array( - 1 => $ibforums->input['sort_by'], - 2 => $this->forum['sort_order'] , - 3 => 'Z-A' ) - ); - - $First = $std->select_var( array( - 1 => $ibforums->input['st'], - 2 => 0 ) - ); - - // Figure out sort order, day cut off, etc - - $Prune = $prune_value != 100 ? (time() - ($prune_value * 60 * 60 * 24)) : 0; - - $sort_keys = array( 'last_post' => 'sort_by_date', - 'title' => 'sort_by_topic', - 'starter_name' => 'sort_by_poster', - 'posts' => 'sort_by_replies', - 'views' => 'sort_by_views', - 'start_date' => 'sort_by_start', - 'last_poster_name' => 'sort_by_last_poster', - ); - - $prune_by_day = array( '1' => 'show_today', - '5' => 'show_5_days', - '7' => 'show_7_days', - '10' => 'show_10_days', - '15' => 'show_15_days', - '20' => 'show_20_days', - '25' => 'show_25_days', - '30' => 'show_30_days', - '60' => 'show_60_days', - '90' => 'show_90_days', - '100' => 'show_all', - ); - - $sort_by_keys = array( 'Z-A' => 'descending_order', - 'A-Z' => 'ascending_order', - ); - - //+---------------------------------------------------------------- - // check for any form funny business by wanna-be hackers - //+---------------------------------------------------------------- - - if ( (!isset($sort_keys[$sort_key])) and (!isset($prune_by_day[$prune_value])) and (!isset($sort_by_keys[$sort_by])) ) - { - $std->Error( array( LEVEL=> 5, MSG =>'incorrect_use') ); - } - - $r_sort_by = $sort_by == 'A-Z' ? 'ASC' : 'DESC'; - - //+---------------------------------------------------------------- - // Query the database to see how many topics there are in the forum - //+---------------------------------------------------------------- - - $DB->query("SELECT COUNT(tid) as max FROM ibf_topics WHERE forum_id='".$this->forum['id']."' and approved='1' and (last_post > $Prune or pinned=1)"); - $total_possible = $DB->fetch_row(); - - //+---------------------------------------------------------------- - // Generate the forum page span links - //+---------------------------------------------------------------- - - $this->forum['SHOW_PAGES'] - = $std->build_pagelinks( array( TOTAL_POSS => $total_possible[max], - PER_PAGE => $ibforums->vars['display_max_topics'], - CUR_ST_VAL => $ibforums->input['st'], - L_SINGLE => $ibforums->lang['single_page_forum'], - L_MULTI => $ibforums->lang['multi_page_forum'], - BASE_URL => $this->base_url."&act=SF&f=".$this->forum['id']."&prune_day=$prune_value&sort_by=$sort_by&sort_order=$sort_order", - ) - ); - - - //+---------------------------------------------------------------- - // Do we have any rules to show? - //+---------------------------------------------------------------- - - if ($this->forum['show_rules']) - { - $DB->query("SELECT * from ibf_rules WHERE fid='".$this->forum['id']."'"); - - if ( $rules = $DB->fetch_row() ) - { - $rules['title'] = stripslashes($rules['title']); - $rules['body'] = stripslashes($rules['body']); - $this->output .= $rules['show_all'] ? $this->html->show_rules_full($rules) : $this->html->show_rules_link($rules); - } - } - - //+---------------------------------------------------------------- - // Generate the poll button - //+---------------------------------------------------------------- - - $this->forum['POLL_BUTTON'] = $this->forum['allow_poll'] - ? "{$ibforums->skin['A_POLL']}" - : ''; - - //+---------------------------------------------------------------- - // Start printing the page - //+---------------------------------------------------------------- - - $this->output .= $this->html->PageTop($this->forum); - - //+---------------------------------------------------------------- - // Do we have any topics to show? - //+---------------------------------------------------------------- - - if ($total_possible['max'] < 1) - { - $this->output .= $this->html->show_no_matches(); - } - - $total_topics_printed = 0; - - if ( ($ibforums->vars['show_user_posted'] == 1) and ($ibforums->member['id']) ) - { - $query = "SELECT DISTINCT ibf_posts.author_id, ibf_topics.* from ibf_topics LEFT JOIN ibf_posts ON (ibf_topics.tid = ibf_posts.topic_id AND ibf_posts.author_id = '".$ibforums->member['id']."') WHERE ibf_topics.forum_id='".$this->forum['id']."' and (ibf_topics.last_post > '$Prune' OR ibf_topics.pinned='1') and ibf_topics.approved='1'"; - } - else - { - $query = "SELECT * from ibf_topics WHERE forum_id='".$this->forum['id']."' and approved='1' and (last_post > '$Prune' OR pinned='1')"; - } - - //+---------------------------------------------------------------- - // Do we have permission to view other posters topics? - //+---------------------------------------------------------------- - - if (!$ibforums->member['g_other_topics']) - { - $query .= " and starter_id='".$ibforums->member['id']."'"; - } - - //+---------------------------------------------------------------- - // Finish off the query - //+---------------------------------------------------------------- - - $First = $First ? $First : 0; - - $query .= " ORDER BY pinned DESC, $sort_key $r_sort_by LIMIT $First,".$ibforums->vars['display_max_topics']; - - $DB->query($query); - - //+---------------------------------------------------------------- - // Grab the rest of the topics and print them - //+---------------------------------------------------------------- - - while ( $topic = $DB->fetch_row() ) - { - $this->output .= $this->render_entry( $topic ); - $total_topics_printed++; - } - - //+---------------------------------------------------------------- - // Finish off the rest of the page - //+---------------------------------------------------------------- - - $ibforums->lang['showing_text'] = preg_replace( "/<#MATCHED_TOPICS#>/", $total_topics_printed , $ibforums->lang['showing_text'] ); - $ibforums->lang['showing_text'] = preg_replace( "/<#TOTAL_TOPICS#>/" , $total_possible['max'] , $ibforums->lang['showing_text'] ); - - $sort_key_html = "\n"; - $sort_by_html = "" , $ibforums->lang['sort_text'] ); - $ibforums->lang['sort_text'] = preg_replace( "!<#ORDER_HTML#>!" , "$sort_by_html" , $ibforums->lang['sort_text'] ); - $ibforums->lang['sort_text'] = preg_replace( "!<#PRUNE_HTML#>!" , "$prune_day_html" , $ibforums->lang['sort_text'] ); - - $this->output .= $this->html->TableEnd($this->forum); - - //+---------------------------------------------------------------- - // Are we a moderator? - //+---------------------------------------------------------------- - - if ( ($ibforums->member['id']) and ($ibforums->member['g_is_supmod'] != 1) ) - { - $DB->query("SELECT mid FROM ibf_moderators WHERE forum_id='".$this->forum['id']."' and member_id='".$ibforums->member['id']."'"); - $this->moderator = $DB->fetch_row(); - } - - //+---------------------------------------------------------------- - // Do we have to print the moderators CP link? - //+---------------------------------------------------------------- - - if ($ibforums->member['g_is_supmod'] or $this->moderator['mid']) - { - $this->output .= $this->html->Mod_Panel( $this->forum['id'] ); - } - - //+---------------------------------------------------------------- - // Print it - //+---------------------------------------------------------------- - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->forum['name'], - 'JS' => 0, - 'NAV' => array( - "{$this->forum['cat_name']}", - $this->nav_extra, - "{$this->forum['name']}", - ), - ) ); - - - - } - - //+---------------------------------------------------------------- - // - // Crunches the data into pwetty html - // - //+---------------------------------------------------------------- - - function render_entry($topic) { - global $DB, $std, $ibforums; - - $topic['last_text'] = $ibforums->lang['last_post_by']; - - $topic['last_poster'] = ($topic['last_poster_id'] != 0) - ? "{$topic['last_poster_name']}" - : "-".$topic['last_poster_name']."-"; - - $topic['starter'] = ($topic['starter_id'] != 0) - ? "{$topic['starter_name']}" - : "-".$topic['starter_name']."-"; - - if ($topic['poll_state']) - { - $topic['prefix'] = $ibforums->vars['pre_polls'].' '; - } - - if ( ($ibforums->member['id']) and ($topic['author_id']) ) - { - $show_dots = 1; - } - - $topic['folder_img'] = $std->folder_icon($topic, $show_dots, $this->read_array[$topic['tid']]); - - $topic['topic_icon'] = $topic['icon_id'] ? '' - : ' '; - - $topic['start_date'] = $std->get_date( $topic['start_date'], 'LONG' ); - - - $pages = 1; - - if ($topic['posts']) - { - if ( (($topic['posts'] + 1) % $ibforums->vars['display_max_posts']) == 0 ) - { - $pages = ($topic['posts'] + 1) / $ibforums->vars['display_max_posts']; - } - else - { - $number = ( ($topic['posts'] + 1) / $ibforums->vars['display_max_posts'] ); - $pages = ceil( $number); - } - - } - - if ($pages > 1) { - $topic['PAGES'] = "({$ibforums->lang['topic_sp_pages']} "; - for ($i = 0 ; $i < $pages ; ++$i ) { - $real_no = $i * $ibforums->vars['display_max_posts']; - $page_no = $i + 1; - if ($page_no == 4) { - $topic['PAGES'] .= "vars['display_max_posts'] . "'>...$pages "; - break; - } else { - $topic['PAGES'] .= "$page_no "; - } - } - $topic['PAGES'] .= ")"; - } - - if ($topic['posts'] < 0) $topic['posts'] = 0; - - $last_time = $this->read_array[ $topic['tid'] ] > $ibforums->input['last_visit'] ? $this->read_array[ $topic['tid'] ] : $ibforums->input['last_visit']; - - if ($last_time && ($topic['last_post'] > $last_time)) - { - $topic['go_last_page'] = "" . $ibforums->skin['GO_LAST_ON'] . ""; - $topic['go_new_post'] = "" . $ibforums->skin['NEW_POST'] . ""; - - } - else - { - $topic['go_last_page'] = "" . $ibforums->skin['GO_LAST_OFF'] . ""; - $topic['go_new_post'] = ""; - } - - - $topic['last_post'] = $std->get_date( $topic['last_post'], 'SHORT' ); - - //+---------------------------------------------------------------- - - if ($topic['state'] == 'link') - { - $t_array = explode("&", $topic['moved_to']); - $topic['tid'] = $t_array[0]; - $topic['forum_id'] = $t_array[1]; - $topic['title'] = $topic['title']; - $topic['views'] = '--'; - $topic['posts'] = '--'; - $topic['prefix'] = $ibforums->vars['pre_moved']." "; - $topic['go_new_post'] = ""; - } - - if ($topic['pinned'] == 1) - { - $topic['prefix'] = $ibforums->vars['pre_pinned']; - $topic['topic_icon'] = $ibforums->skin['B_PIN']; - - } - - return $this->html->RenderRow( $topic ); - } - - - //+---------------------------------------------------------------- - // - // Returns the last action date - // - //+---------------------------------------------------------------- - - function get_last_date($topic) { - global $ibforums, $std; - - return $std->get_date( $topic['last_post'], 'SHORT' ); - - } - - -} - -?> + Forum topic index module +| > Module written by Matt Mecham +| > Date started: 14th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Forums; + +class Forums { + + var $output = ""; + var $base_url = ""; + var $html = ""; + var $moderator = array(); + var $forum = array(); + var $show_dots = ""; + var $nav_extra = ""; + var $read_array = array(); + var $board_html = ""; + var $sub_output = ""; + var $pinned_print = 0; + + //+---------------------------------------------------------------- + // + // Our constructor, load words, load skin, get DB forum/cat data + // + //+---------------------------------------------------------------- + + function Forums() { + global $ibforums, $DB, $std, $print, $skin_universal; + + $ibforums->input['f'] = intval($ibforums->input['f']); + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_forum', $ibforums->lang_id); + + $this->html = $std->load_template('skin_forum'); + + // Get the forum info based on the forum ID, and get the category name, ID, etc. + + $DB->query("SELECT f.*, c.id as cat_id, c.name as cat_name + FROM ibf_forums f + LEFT JOIN ibf_categories c ON (c.id=f.category) + WHERE f.id=".$ibforums->input['f']); + + $this->forum = $DB->fetch_row(); + + //---------------------------------------- + // Error out if we can not find the forum + //---------------------------------------- + + if (!$this->forum['id']) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + + //---------------------------------------- + // If this is a sub forum, we need to get + // the cat details, and parent details + //---------------------------------------- + + if ($this->forum['parent_id'] > 0) + { + + $DB->query("SELECT f.id as forum_id, f.name as forum_name, c.id, c.name FROM ibf_forums f, ibf_categories c WHERE f.id='".$this->forum['parent_id']."' AND c.id=f.category"); + + $row = $DB->fetch_row(); + + $this->forum['cat_id'] = $row['id']; + $this->forum['cat_name'] = $row['name']; + + $this->nav_extra = "{$row['forum_name']}"; + } + + //-------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------- + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + + $this->forum['FORUM_JUMP'] = $std->build_forum_jump(); + $this->forum['FORUM_JUMP'] = preg_replace( "!#Forum Jump#!", $ibforums->lang['forum_jump'], $this->forum['FORUM_JUMP']); + + + + // Are we viewing the forum, or viewing the forum rules? + + if ($ibforums->input['act'] == 'SR') + { + $this->show_rules(); + } + else + { + if ($this->forum['subwrap'] == 1) + { + $this->show_subforums(); + + if ($this->forum['sub_can_post']) + { + $this->show_forum(); + } + else + { + // No forum to show, just use the HTML in $this->sub_output + // or there will be no HTML to use in the str_replace! + + $this->output = $this->sub_output; + $this->sub_output = ""; + } + } + else + { + $this->show_forum(); + } + } + + //+---------------------------------------------------------------- + // Print it + //+---------------------------------------------------------------- + + if ($this->sub_output != "") + { + $this->output = str_replace( "", $this->sub_output, $this->output ); + } + + if ($ibforums->member['id'] > 0) + { + $this->output = str_replace( "", $this->html->show_sub_link($this->forum['id']), $this->output ); + } + + $print->add_output($this->output); + $print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->forum['name'], + 'JS' => 0, + 'NAV' => array( + "{$this->forum['cat_name']}", + $this->nav_extra, + "{$this->forum['name']}", + ), + ) ); + + } + + //+---------------------------------------------------------------- + // Display any sub forums + //+---------------------------------------------------------------- + + + function show_subforums() { + + global $std, $DB, $ibforums; + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_boards', $ibforums->lang_id); + + $this->board_html = $std->load_template('skin_boards'); + + $fid = $ibforums->input['f']; + + $DB->query("SELECT * FROM ibf_forums WHERE parent_id='$fid' ORDER BY position"); + + if ( ! $DB->get_num_rows() ) + { + return ""; + } + + while ( $data = $DB->fetch_row() ) + { + $temp_html .= $this->process_forum($data['id'], $data); + } + + if ($temp_html != "") + { + $this->sub_output .= $this->board_html->subheader(); + $this->sub_output .= $temp_html; + $this->sub_output .= $this->board_html->end_this_cat(); + } + else + { + return $this->sub_output; + } + unset($temp_html); + + $this->sub_output .= $this->board_html->end_all_cats(); + } + + + + function process_forum($forum_id="", $forum_data="") + { + global $std, $ibforums; + + //-------------------------------------- + // Check permissions... + //-------------------------------------- + + if ($forum_data['read_perms'] != '*') + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $forum_data['read_perms'] ) ) + { + return ""; + } + } + + $forum_data['img_new_post'] = $std->forum_new_posts($forum_data); + + $forum_data['last_post'] = $std->get_date($forum_data['last_post'], 'LONG'); + + $forum_data['last_topic'] = $ibforums->lang['f_none']; + + if (isset($forum_data['last_title']) and $forum_data['last_id'] != "") + { + + $forum_data['last_title'] = str_replace( "!" , "!", $forum_data['last_title'] ); + $forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] ); + + if (strlen($forum_data['last_title']) > 30) + { + $forum_data['last_title'] = substr($forum_data['last_title'],0,27) . "..."; + $forum_data['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $forum_data['last_title'] ); + } + + if ($forum_data['password'] != "") + { + $forum_data['last_topic'] = $ibforums->lang['f_protected']; + } + else + { + $forum_data['last_topic'] = "vars['php_ext']}?s={$ibforums->session_id}&act=ST&f={$forum_data['id']}&t={$forum_data['last_id']}&view=getlastpost'>{$forum_data['last_title']}"; + } + } + + if ( isset($forum_data['last_poster_name'])) + { + $forum_data['last_poster'] = $forum_data['last_poster_id'] ? "vars['php_ext']}?s={$ibforums->session_id}&act=Profile&CODE=03&MID={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}" + : $forum_data['last_poster_name']; + } + else + { + $forum_data['last_poster'] = $ibforums->lang['f_none']; + } + + //--------------------------------- + // Moderators + //--------------------------------- + + $forum_data['moderator'] = ""; + + if (isset($this->mods[ $forum_data['id'] ] ) ) + { + $forum_data['moderator'] = $ibforums->lang['forum_leader'].' '; + + if (is_array($this->mods[ $forum_data['id'] ]) ) + { + foreach ($this->mods[ $forum_data['id'] ] as $moderator) + { + if ($moderator['isg'] == 1) + { + $forum_data['moderator'] .= "{$moderator['gname']}, "; + } + else + { + $forum_data['moderator'] .= "{$moderator['name']}, "; + } + } + + $forum_data['moderator'] = preg_replace( "!,\s+$!", "", $forum_data['moderator'] ); + + } + else + { + if ($moderator['isg'] == 1) + { + $forum_data['moderator'] .= "{$this->mods[$forum_data['id']]['gname']}, "; + } + else + { + $forum_data['moderator'] .= "{$this->mods[$forum_data['id']]['name']}"; + } + } + } + + return $this->board_html->ForumRow($forum_data); + } + + //+---------------------------------------------------------------- + // + // Show the forum rules on a seperate page + // + //+---------------------------------------------------------------- + + function show_rules() { + global $DB, $ibforums, $std, $print; + + //+-------------------------------------------- + // Do we have permission to view these rules? + //+-------------------------------------------- + + $bad_entry = $this->check_access(); + + if ($bad_entry == 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_topic') ); + } + + //+-------------------------------------------- + // Get the rules from the DB + //+-------------------------------------------- + + $DB->query("SELECT * FROM ibf_rules WHERE fid='".$ibforums->input['f']."'"); + + if ( $rules = $DB->fetch_row() ) + { + $rules['title'] = stripslashes($rules['title']); + $rules['body'] = stripslashes($rules['body']); + + $this->output .= $this->html->show_rules($rules); + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => "IBForums -> ".$this->forum['name'], + 'JS' => 0, + 'NAV' => array( + "{$this->forum['cat_name']}", + ), + ) ); + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_topic') ); + } + } + + //+---------------------------------------------------------------- + // + // Forum view check for authentication + // + //+---------------------------------------------------------------- + + function show_forum() { + global $ibforums; + // are we checking for user authentication via the log in form + // for a private forum w/password protection? + + $ibforums->input['L'] == 1 ? $this->authenticate_user() : $this->render_forum(); + } + + //+---------------------------------------------------------------- + // + // Authenicate the log in for a password protected forum + // + //+---------------------------------------------------------------- + + function authenticate_user() { + global $std, $ibforums, $print; + + if ($ibforums->input['f_password'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) ); + } + + if ($ibforums->input['f_password'] != $this->forum['password']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'wrong_pass' ) ); + } + + $std->my_setcookie( "iBForum".$this->forum['id'], $ibforums->input['f_password'] ); + + $print->redirect_screen( $ibforums->lang['logged_in'] , "act=SF&f=".$this->forum['id'] ); + + } + + //+---------------------------------------------------------------------------------- + + function check_access() { + global $ibforums, $HTTP_COOKIE_VARS; + + $return = 1; + + if ($this->forum['read_perms'] == '*') + { + $return = 0; + } + else if (preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) ) + { + $return = 0; + } + + // Do we have permission to even see the password page? + + if ($return == 0) + { + if ($this->forum['password']) + { + if ($HTTP_COOKIE_VARS[ $ibforums->vars['cookie_id'].'iBForum'.$this->forum['id'] ] == $this->forum['password']) + { + $return = 0; + } + else + { + $this->forum_login(); + } + } + } + + return $return; + + } + + //+---------------------------------------------------------------------------------- + + function forum_login() { + global $ibforums, $std, $DB, $HTTP_COOKIE_VARS, $print; + + if (empty($ibforums->member['id'])) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) ); + } + + $this->output = $this->html->Forum_log_in( $this->forum['id'] ); + + $print->add_output("$this->output"); + + $print->do_output( array( 'TITLE' => $ibforums->vars['board_name']." -> ".$this->forum['name'], + 'JS' => 0, + 'NAV' => array( + "{$this->forum['cat_name']}", + "{$this->forum['name']}", + ), + ) ); + + } + + //+---------------------------------------------------------------- + // + // Main render forum engine + // + //+---------------------------------------------------------------- + + function render_forum() { + global $ibforums, $DB, $std, $print, $HTTP_COOKIE_VARS; + + $bad_entry = $this->check_access(); + + if ($bad_entry == 1) + { + if ($this->forum['subwrap'] == 1) + { + // Dont' show an error as we may have sub forums up top + // Instead, copy the sub forum ouput to the main output + // and return gracefully + + $this->output = $this->sub_output; + $this->sub_output = ""; + + return TRUE; + } + else + { + $std->Error( array( LEVEL => 1, MSG => 'no_permission') ); + } + } + + if ( $read = $std->my_getcookie('topicsread') ) + { + $this->read_array = unserialize(stripslashes($read)); + } + + if ( $forum = $std->my_getcookie('fread_'.$ibforums->input['f']) ) + { + $ibforums->input['last_visit'] = $forum > $ibforums->input['last_visit'] ? $forum : $ibforums->input['last_visit']; + } + + $prune_value = $std->select_var( array( + 1 => $ibforums->input['prune_day'], + 2 => $this->forum['prune'] , + 3 => '100' ) + ); + + $sort_key = $std->select_var( array( + 1 => $ibforums->input['sort_key'], + 2 => $this->forum['sort_key'] , + 3 => 'last_post' ) + ); + + $sort_by = $std->select_var( array( + 1 => $ibforums->input['sort_by'], + 2 => $this->forum['sort_order'] , + 3 => 'Z-A' ) + ); + + $First = $std->select_var( array( + 1 => intval($ibforums->input['st']), + 2 => 0 ) + ); + + // Figure out sort order, day cut off, etc + + $Prune = $prune_value != 100 ? (time() - ($prune_value * 60 * 60 * 24)) : 0; + + $sort_keys = array( 'last_post' => 'sort_by_date', + 'title' => 'sort_by_topic', + 'starter_name' => 'sort_by_poster', + 'posts' => 'sort_by_replies', + 'views' => 'sort_by_views', + 'start_date' => 'sort_by_start', + 'last_poster_name' => 'sort_by_last_poster', + ); + + $prune_by_day = array( '1' => 'show_today', + '5' => 'show_5_days', + '7' => 'show_7_days', + '10' => 'show_10_days', + '15' => 'show_15_days', + '20' => 'show_20_days', + '25' => 'show_25_days', + '30' => 'show_30_days', + '60' => 'show_60_days', + '90' => 'show_90_days', + '100' => 'show_all', + ); + + $sort_by_keys = array( 'Z-A' => 'descending_order', + 'A-Z' => 'ascending_order', + ); + + //+---------------------------------------------------------------- + // check for any form funny business by wanna-be hackers + //+---------------------------------------------------------------- + + if ( (!isset($sort_keys[$sort_key])) and (!isset($prune_by_day[$prune_value])) and (!isset($sort_by_keys[$sort_by])) ) + { + $std->Error( array( LEVEL=> 5, MSG =>'incorrect_use') ); + } + + $r_sort_by = $sort_by == 'A-Z' ? 'ASC' : 'DESC'; + + //+---------------------------------------------------------------- + // Query the database to see how many topics there are in the forum + //+---------------------------------------------------------------- + + $DB->query("SELECT COUNT(tid) as max FROM ibf_topics WHERE forum_id='".$this->forum['id']."' and approved='1' and (last_post > $Prune or pinned=1)"); + $total_possible = $DB->fetch_row(); + + //+---------------------------------------------------------------- + // Generate the forum page span links + //+---------------------------------------------------------------- + + $this->forum['SHOW_PAGES'] + = $std->build_pagelinks( array( 'TOTAL_POSS' => $total_possible[max], + 'PER_PAGE' => $ibforums->vars['display_max_topics'], + 'CUR_ST_VAL' => $ibforums->input['st'], + 'L_SINGLE' => $ibforums->lang['single_page_forum'], + 'L_MULTI' => $ibforums->lang['multi_page_forum'], + 'BASE_URL' => $this->base_url."&act=SF&f=".$this->forum['id']."&prune_day=$prune_value&sort_by=$sort_by&sort_key=$sort_key", + ) + ); + + + //+---------------------------------------------------------------- + // Do we have any rules to show? + //+---------------------------------------------------------------- + + if ($this->forum['show_rules']) + { + $DB->query("SELECT * from ibf_rules WHERE fid='".$this->forum['id']."'"); + + if ( $rules = $DB->fetch_row() ) + { + $rules['title'] = stripslashes($rules['title']); + $rules['body'] = stripslashes($rules['body']); + $this->output .= $rules['show_all'] ? $this->html->show_rules_full($rules) : $this->html->show_rules_link($rules); + } + } + + //+---------------------------------------------------------------- + // Generate the poll button + //+---------------------------------------------------------------- + + $this->forum['POLL_BUTTON'] = $this->forum['allow_poll'] + ? "<{A_POLL}>" + : ''; + + //+---------------------------------------------------------------- + // Start printing the page + //+---------------------------------------------------------------- + + $this->output .= $this->html->PageTop($this->forum); + + //+---------------------------------------------------------------- + // Do we have any topics to show? + //+---------------------------------------------------------------- + + if ($total_possible['max'] < 1) + { + $this->output .= $this->html->show_no_matches(); + } + + $total_topics_printed = 0; + + if ( ($ibforums->vars['show_user_posted'] == 1) and ($ibforums->member['id']) ) + { + $query = "SELECT DISTINCT ibf_posts.author_id, ibf_topics.* from ibf_topics LEFT JOIN ibf_posts ON (ibf_topics.tid = ibf_posts.topic_id AND ibf_posts.author_id = '".$ibforums->member['id']."') WHERE ibf_topics.forum_id='".$this->forum['id']."' and (ibf_topics.last_post > '$Prune' OR ibf_topics.pinned='1') and ibf_topics.approved='1'"; + } + else + { + $query = "SELECT * from ibf_topics WHERE forum_id='".$this->forum['id']."' and approved='1' and (last_post > '$Prune' OR pinned='1')"; + } + + //+---------------------------------------------------------------- + // Do we have permission to view other posters topics? + //+---------------------------------------------------------------- + + if (!$ibforums->member['g_other_topics']) + { + $query .= " and starter_id='".$ibforums->member['id']."'"; + } + + //+---------------------------------------------------------------- + // Finish off the query + //+---------------------------------------------------------------- + + $First = $First ? $First : 0; + + $query .= " ORDER BY pinned DESC, $sort_key $r_sort_by LIMIT $First,".$ibforums->vars['display_max_topics']; + + $DB->query($query); + + //+---------------------------------------------------------------- + // Grab the rest of the topics and print them + //+---------------------------------------------------------------- + + while ( $topic = $DB->fetch_row() ) + { + $this->output .= $this->render_entry( $topic ); + $total_topics_printed++; + } + + //+---------------------------------------------------------------- + // Finish off the rest of the page + //+---------------------------------------------------------------- + + $ibforums->lang['showing_text'] = preg_replace( "/<#MATCHED_TOPICS#>/", $total_topics_printed , $ibforums->lang['showing_text'] ); + $ibforums->lang['showing_text'] = preg_replace( "/<#TOTAL_TOPICS#>/" , $total_possible['max'] , $ibforums->lang['showing_text'] ); + + $sort_key_html = "\n"; + $sort_by_html = "" , $ibforums->lang['sort_text'] ); + $ibforums->lang['sort_text'] = preg_replace( "!<#ORDER_HTML#>!" , "$sort_by_html" , $ibforums->lang['sort_text'] ); + $ibforums->lang['sort_text'] = preg_replace( "!<#PRUNE_HTML#>!" , "$prune_day_html" , $ibforums->lang['sort_text'] ); + + $this->output .= $this->html->TableEnd($this->forum); + + //+---------------------------------------------------------------- + // Process users active in this forum + //+---------------------------------------------------------------- + + if ($ibforums->vars['no_au_forum'] != 1) + { + //+----------------------------------------- + // Is this forum restricted, or global? + //+----------------------------------------- + + if ($this->forum['read_perms'] != '*') + { + $q_extra = " AND s.member_group IN (-2,".$this->forum['read_perms'].") "; + } + + //+----------------------------------------- + // Get the users + //+----------------------------------------- + + $cut_off = ($ibforums->vars['au_cutoff'] != "") ? $ibforums->vars['au_cutoff'] * 60 : 900; + + $time = time() - $cut_off; + + $DB->query("SELECT s.member_id, s.member_name, s.login_type, s.location, g.suffix, g.prefix + FROM ibf_sessions s + LEFT JOIN ibf_groups g ON (g.g_id=s.member_group) + WHERE s.in_forum='{$this->forum['id']}' + AND s.running_time > '$time'" + .$q_extra. + "ORDER BY s.running_time DESC"); + + //+----------------------------------------- + // Cache all printed members so we don't double print them + //+----------------------------------------- + + $cached = array(); + $active = array( 'guests' => 0, 'anon' => 0, 'members' => 0, 'names' => ""); + + while ($result = $DB->fetch_row() ) + { + if ($result['member_id'] == 0) + { + $active['guests']++; + } + else + { + if (empty( $cached[ $result['member_id'] ] ) ) + { + $cached[ $result['member_id'] ] = 1; + + if ($result['login_type'] == 1) + { + if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_admin_anon'] != 1) ) + { + $active['names'] .= "{$result['prefix']}{$result['member_name']}{$result['suffix']}*, "; + $active['anon']++; + } + else + { + $active['anon']++; + } + } + else + { + $active['members']++; + $active['names'] .= "{$result['prefix']}{$result['member_name']}{$result['suffix']}, "; + } + } + } + } + + $active['names'] = preg_replace( "/,\s+$/", "" , $active['names'] ); + + $ibforums->lang['active_users_title'] = sprintf( $ibforums->lang['active_users_title'] , ($active['members'] + $active['guests'] + $active['anon'] ) ); + $ibforums->lang['active_users_detail'] = sprintf( $ibforums->lang['active_users_detail'] , $active['guests'],$active['anon'] ); + $ibforums->lang['active_users_members'] = sprintf( $ibforums->lang['active_users_members'], $active['members'] ); + + $this->output = str_replace( "", $this->html->forum_active_users($active), $this->output ); + + } + + return TRUE; + + } + + //+---------------------------------------------------------------- + // + // Crunches the data into pwetty html + // + //+---------------------------------------------------------------- + + function render_entry($topic) { + global $DB, $std, $ibforums; + + $topic['last_text'] = $ibforums->lang['last_post_by']; + + $topic['last_poster'] = ($topic['last_poster_id'] != 0) + ? "{$topic['last_poster_name']}" + : "-".$topic['last_poster_name']."-"; + + $topic['starter'] = ($topic['starter_id'] != 0) + ? "{$topic['starter_name']}" + : "-".$topic['starter_name']."-"; + + if ($topic['poll_state']) + { + $topic['prefix'] = $ibforums->vars['pre_polls'].' '; + } + + if ( ($ibforums->member['id']) and ($topic['author_id']) ) + { + $show_dots = 1; + } + + $topic['folder_img'] = $std->folder_icon($topic, $show_dots, $this->read_array[$topic['tid']]); + + $topic['topic_icon'] = $topic['icon_id'] ? '' + : ' '; + + $topic['start_date'] = $std->get_date( $topic['start_date'], 'LONG' ); + + + $pages = 1; + + if ($topic['posts']) + { + if ( (($topic['posts'] + 1) % $ibforums->vars['display_max_posts']) == 0 ) + { + $pages = ($topic['posts'] + 1) / $ibforums->vars['display_max_posts']; + } + else + { + $number = ( ($topic['posts'] + 1) / $ibforums->vars['display_max_posts'] ); + $pages = ceil( $number); + } + + } + + if ($pages > 1) { + $topic['PAGES'] = "({$ibforums->lang['topic_sp_pages']} "; + for ($i = 0 ; $i < $pages ; ++$i ) { + $real_no = $i * $ibforums->vars['display_max_posts']; + $page_no = $i + 1; + if ($page_no == 4) { + $topic['PAGES'] .= "vars['display_max_posts'] . "'>...$pages "; + break; + } else { + $topic['PAGES'] .= "$page_no "; + } + } + $topic['PAGES'] .= ")"; + } + + if ($topic['posts'] < 0) $topic['posts'] = 0; + + $last_time = $this->read_array[ $topic['tid'] ] > $ibforums->input['last_visit'] ? $this->read_array[ $topic['tid'] ] : $ibforums->input['last_visit']; + + if ($last_time && ($topic['last_post'] > $last_time)) + { + $topic['go_last_page'] = "<{GO_LAST_ON}>"; + $topic['go_new_post'] = "<{NEW_POST}>"; + + } + else + { + $topic['go_last_page'] = "<{GO_LAST_OFF}>"; + $topic['go_new_post'] = ""; + } + + + $topic['last_post'] = $std->get_date( $topic['last_post'], 'SHORT' ); + + //+---------------------------------------------------------------- + + if ($topic['state'] == 'link') + { + $t_array = explode("&", $topic['moved_to']); + $topic['tid'] = $t_array[0]; + $topic['forum_id'] = $t_array[1]; + $topic['title'] = $topic['title']; + $topic['views'] = '--'; + $topic['posts'] = '--'; + $topic['prefix'] = $ibforums->vars['pre_moved']." "; + $topic['go_new_post'] = ""; + } + else + { + $topic['posts'] = $this->html->who_link($topic['tid'], $topic['posts']); + } + + $p_start = ""; + $p_end = ""; + + if ($topic['pinned'] == 1) + { + $topic['prefix'] = $ibforums->vars['pre_pinned']; + $topic['topic_icon'] = "<{B_PIN}>"; + + if ($this->pinned_print == 0) + { + // we've a pinned topic, but we've not printed the pinned + // starter row, so.. + + $p_start = $this->html->render_pinned_start(); + + $this->pinned_print = 1; + } + + return $p_start . $this->html->render_pinned_row( $topic ); + } + else + { + // This is not a pinned topic, so lets check to see if we've + // printed the footer yet. + + if ($this->pinned_print == 1) + { + // Nope, so.. + $p_end = $this->html->render_pinned_end(); + + $this->pinned_print = 0; + } + + return $p_end . $this->html->RenderRow( $topic ); + } + } + + + //+---------------------------------------------------------------- + // + // Returns the last action date + // + //+---------------------------------------------------------------- + + function get_last_date($topic) { + global $ibforums, $std; + + return $std->get_date( $topic['last_post'], 'SHORT' ); + + } + + +} + +?> diff --git a/upload/sources/Help.php b/upload/sources/Help.php index b2edf132..fb2ab7ab 100644 --- a/upload/sources/Help.php +++ b/upload/sources/Help.php @@ -1,183 +1,181 @@ - Access the help files -| > Module written by Matt Mecham -| > Date started: 24th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Help; - -class Help { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $html = ""; - - - - function Help() { - global $ibforums, $DB, $std, $print; - - - if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = '00'; - - //-------------------------------------------- - // Require the HTML and language modules - //-------------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_help', $ibforums->lang_id ); - - require "./Skin/".$ibforums->skin_id."/skin_help.php"; - - $this->html = new skin_help(); - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - - - //-------------------------------------------- - // What to do? - //-------------------------------------------- - - switch($ibforums->input['CODE']) { - case '01': - $this->show_section(); - break; - case '02': - $this->do_search(); - break; - default: - $this->show_titles(); - break; - } - - // If we have any HTML to print, do so... - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - } - - function show_titles() { - global $ibforums, $DB, $std; - - $seen = array(); - - $this->output = $this->html->start( $ibforums->lang['page_title'], $ibforums->lang['help_txt'], $ibforums->lang['choose_file'] ); - - $DB->query("SELECT id, title, description from ibf_faq ORDER BY title ASC"); - - $cnt = 0; - - while ($row = $DB->fetch_row() ) { - - if (isset($seen[ $row['title'] ]) ) { - continue; - } else { - $seen[ $row['title'] ] = 1; - } - - $row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2'; - - $cnt++; - - $this->output .= $this->html->row($row); - - } - - $this->output .= $this->html->end(); - - $this->page_title = $ibforums->lang['page_title']; - $this->nav = array( $ibforums->lang['page_title'] ); - - } - - function show_section() { - global $ibforums, $DB, $std; - - $id = $ibforums->input['HID']; - - if (! preg_match( "/^(\d+)$/" , $id ) ) { - $std->Error( array( LEVEL => 1, MSG => 'no_search_id') ); - } - - $DB->query("SELECT id, title, text from ibf_faq WHERE ID='$id'"); - $topic = $DB->fetch_row(); - - $this->output = $this->html->start( $ibforums->lang['help_topic'], $ibforums->lang['topic_text'], $topic['title'] ); - $this->output .= $this->html->display( $std->text_tidy( $topic['text'] ) ); - - $this->output .= $this->html->end(); - - $this->page_title = $ibforums->lang['help_topic']; - $this->nav = array( "{$ibforums->lang['help_topics']}", $ibforums->lang['help_topic'] ); - - } - - function do_search() { - global $ibforums, $DB, $std; - - if (empty( $ibforums->input['search_q'] ) ) { - $std->Error( array( LEVEL => 1, MSG => 'search_no_input') ); - } - - $search_string = strtolower( str_replace( "*" , "%", $ibforums->input['search_q'] ) ); - $search_string = preg_replace( "/[<>\!\@£\$\^&\+\=\=\[\]\{\}\(\)\"':;\.,\/]/", "", $search_string ); - - $seen = array(); - - $this->output = $this->html->start( $ibforums->lang['search_results'], $ibforums->lang['results_txt'], $ibforums->lang['search_results'] ); - - $DB->query("SELECT id, title from ibf_faq WHERE LOWER(title) LIKE '%$search_string%' or LOWER(text) LIKE '%$search_string%' ORDER BY title ASC"); - - $cnt = 0; - - while ($row = $DB->fetch_row() ) { - - if (isset($seen[ $row['title'] ]) ) { - continue; - } else { - $seen[ $row['title'] ] = 1; - } - - $row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2'; - - $cnt++; - - $this->output .= $this->html->row($row); - - } - - if ($cnt == 0) { - $this->output .= $this->html->no_results(); - } - - $this->output .= $this->html->end(); - - $this->page_title = $ibforums->lang['page_title']; - $this->nav = array( "{$ibforums->lang['help_topics']}", $ibforums->lang['results_title'] ); - - } - - -} - -?> + Access the help files +| > Module written by Matt Mecham +| > Date started: 24th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Help; + +class Help { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $html = ""; + + + + function Help() { + global $ibforums, $DB, $std, $print; + + + if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = '00'; + + //-------------------------------------------- + // Require the HTML and language modules + //-------------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_help', $ibforums->lang_id ); + + $this->html = $std->load_template('skin_help'); + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + + + + //-------------------------------------------- + // What to do? + //-------------------------------------------- + + switch($ibforums->input['CODE']) { + case '01': + $this->show_section(); + break; + case '02': + $this->do_search(); + break; + default: + $this->show_titles(); + break; + } + + // If we have any HTML to print, do so... + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + function show_titles() { + global $ibforums, $DB, $std; + + $seen = array(); + + $this->output = $this->html->start( $ibforums->lang['page_title'], $ibforums->lang['help_txt'], $ibforums->lang['choose_file'] ); + + $DB->query("SELECT id, title, description from ibf_faq ORDER BY title ASC"); + + $cnt = 0; + + while ($row = $DB->fetch_row() ) { + + if (isset($seen[ $row['title'] ]) ) { + continue; + } else { + $seen[ $row['title'] ] = 1; + } + + $row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2'; + + $cnt++; + + $this->output .= $this->html->row($row); + + } + + $this->output .= $this->html->end(); + + $this->page_title = $ibforums->lang['page_title']; + $this->nav = array( $ibforums->lang['page_title'] ); + + } + + function show_section() { + global $ibforums, $DB, $std; + + $id = $ibforums->input['HID']; + + if (! preg_match( "/^(\d+)$/" , $id ) ) { + $std->Error( array( LEVEL => 1, MSG => 'no_search_id') ); + } + + $DB->query("SELECT id, title, text from ibf_faq WHERE ID='$id'"); + $topic = $DB->fetch_row(); + + $this->output = $this->html->start( $ibforums->lang['help_topic'], $ibforums->lang['topic_text'], $topic['title'] ); + $this->output .= $this->html->display( $std->text_tidy( $topic['text'] ) ); + + $this->output .= $this->html->end(); + + $this->page_title = $ibforums->lang['help_topic']; + $this->nav = array( "{$ibforums->lang['help_topics']}", $ibforums->lang['help_topic'] ); + + } + + function do_search() { + global $ibforums, $DB, $std; + + if (empty( $ibforums->input['search_q'] ) ) { + $std->Error( array( LEVEL => 1, MSG => 'search_no_input') ); + } + + $search_string = strtolower( str_replace( "*" , "%", $ibforums->input['search_q'] ) ); + $search_string = preg_replace( "/[<>\!\@£\$\^&\+\=\=\[\]\{\}\(\)\"':;\.,\/]/", "", $search_string ); + + $seen = array(); + + $this->output = $this->html->start( $ibforums->lang['search_results'], $ibforums->lang['results_txt'], $ibforums->lang['search_results'] ); + + $DB->query("SELECT id, title from ibf_faq WHERE LOWER(title) LIKE '%$search_string%' or LOWER(text) LIKE '%$search_string%' ORDER BY title ASC"); + + $cnt = 0; + + while ($row = $DB->fetch_row() ) { + + if (isset($seen[ $row['title'] ]) ) { + continue; + } else { + $seen[ $row['title'] ] = 1; + } + + $row['CELL_COLOUR'] = $cnt % 2 ? 'row1' : 'row2'; + + $cnt++; + + $this->output .= $this->html->row($row); + + } + + if ($cnt == 0) { + $this->output .= $this->html->no_results(); + } + + $this->output .= $this->html->end(); + + $this->page_title = $ibforums->lang['page_title']; + $this->nav = array( "{$ibforums->lang['help_topics']}", $ibforums->lang['results_title'] ); + + } + + +} + +?> diff --git a/upload/sources/Login.php b/upload/sources/Login.php index 2343119f..16165103 100644 --- a/upload/sources/Login.php +++ b/upload/sources/Login.php @@ -1,427 +1,468 @@ - Log in / log out module -| > Module written by Matt Mecham -| > Date started: 14th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Login; - -class Login { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $login_html = ""; - - function Login() { - global $ibforums, $DB, $std, $print; - - // Make sure our code number is numerical only - - //$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input[CODE]); - - // Require the HTML and language modules - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_login', $ibforums->lang_id); - - require "./Skin/".$ibforums->skin_id."/skin_login.php"; - $this->login_html = new skin_login(); - - - // Are we enforcing log ins? - - if ($ibforums->vars['force_login'] == 1) - { - $msg = 'admin_force_log_in'; - } - else - { - $msg = ""; - } - - // What to do? - - switch($ibforums->input['CODE']) { - case '01': - $this->do_log_in(); - break; - case '02': - $this->log_in_form(); - break; - case '03': - $this->do_log_out(); - break; - - case '04': - $this->markforum(); - break; - - case '05': - $this->markboard(); - break; - - case '06': - $this->delete_cookies(); - break; - - default: - $this->log_in_form($msg); - break; - } - - // If we have any HTML to print, do so... - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - } - - function delete_cookies() - { - global $ibforums, $DB, $std, $HTTP_COOKIE_VARS; - - if (is_array($HTTP_COOKIE_VARS)) - { - foreach( $HTTP_COOKIE_VARS as $cookie => $value) - { - if (preg_match( "/^(".$ibforums->vars['cookie_id']."fread.*$)/", $cookie, $match)) - { - $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-1', -1 ); - } - - if (preg_match( "/^(".$ibforums->vars['cookie_id']."ibforum.*$)/i", $cookie, $match)) - { - $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-', -1 ); - } - } - } - - $std->my_setcookie('pass_hash' , '-1'); - $std->my_setcookie('member_id' , '-1'); - $std->my_setcookie('session_id', '-1'); - $std->my_setcookie('topicsread', '-1'); - $std->my_setcookie('anonlogin' , '-1'); - - $std->boink_it($ibforums->base_url); - exit(); - } - - - function markboard() - { - global $ibforums, $DB, $std; - - if(! $ibforums->member['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'no_guests') ); - } - - $DB->query("UPDATE ibf_members SET last_visit='".time()."', last_activity='".time()."' WHERE id='".$ibforums->member['id']."'"); - - $std->boink_it($ibforums->base_url); - exit(); - } - - - function markforum() { - global $ibforums, $DB, $std; - - $ibforums->input['f'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['f'] ); - - if ($ibforums->input['f'] == "") - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files' ) ); - } - - $std->my_setcookie( "fread_".$ibforums->input['f'], time() ); - - $std->boink_it($ibforums->base_url); - exit(); - - } - - - - - function log_in_form($message="") { - global $ibforums, $DB, $std, $print, $HTTP_REFERER; - - //+-------------------------------------------- - //| Are they banned? - //+-------------------------------------------- - - if ($ibforums->vars['ban_ip']) - { - $ips = explode( "|", $ibforums->vars['ban_ip'] ); - foreach ($ips as $ip) - { - $ip = preg_replace( "/\*/", '.*' , $ip ); - if (preg_match( "/$ip/", $ibforums->input['IP_ADDRESS'] )) - { - $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); - } - } - } - - //+-------------------------------------------- - - if ($message != "") - { - $message = $ibforums->lang[ $message ]; - $message = preg_replace( "/<#NAME#>/", "{$ibforums->input[UserName]}", $message ); - - $this->output .= $this->login_html->errors($message); - } - - $this->login_html->IN[REFERER] = $HTTP_REFERER; - - $this->output .= $this->login_html->ShowForm( $ibforums->lang['please_log_in'] ); - - $this->nav = array( $ibforums->lang['log_in'] ); - $this->page_title = $ibforums->lang['log_in']; - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - exit(); - - } - - function do_log_in() { - global $DB, $ibforums, $std, $print, $sess, $HTTP_USER_AGENT, $HTTP_POST_VARS; - - $url = ""; - - //------------------------------------------------- - // Make sure the username and password were entered - //------------------------------------------------- - - if ($HTTP_POST_VARS['UserName'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); - } - - if ($HTTP_POST_VARS['PassWord'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) ); - } - - - //------------------------------------------------- - // Check for input length - //------------------------------------------------- - - if (strlen($ibforums->input['UserName']) > 32) - { - $std->Error( array( LEVEL => 1, MSG => 'username_long' ) ); - } - - if (strlen($ibforums->input['PassWord']) > 32) - { - $std->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) ); - } - - $username = strtolower($ibforums->input['UserName']); - $password = md5( $ibforums->input['PassWord'] ); - - //------------------------------------------------- - // Attempt to get the user details - //------------------------------------------------- - - $DB->query("SELECT id, name, mgroup, password, new_pass FROM ibf_members WHERE LOWER(name)='$username'"); - - if ($DB->get_num_rows()) - { - $member = $DB->fetch_row(); - - if ( empty($member['id']) or ($member['id'] == "") ) - { - $this->log_in_form( 'wrong_name' ); - } - - if ($member['password'] != $password) - { - $this->log_in_form( 'wrong_pass' ); - } - - //------------------------------ - - if ($ibforums->input['CookieDate']) - { - $std->my_setcookie("member_id" , $member['id'], 1); - $std->my_setcookie("pass_hash" , $password, 1); - } - - //------------------------------ - - if ($ibforums->input['s']) - { - $session_id = $ibforums->input['s']; - - // Delete any old sessions with this users IP addy that doesn't match our - // session ID. - - $DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."' AND id <> '$session_id'"); - - $db_string = $DB->compile_db_update_string( array ( - 'member_name' => $member['name'], - 'member_pass' => "", - 'member_id' => $member['id'], - 'running_time' => time(), - 'member_group' => $member['mgroup'], - 'login_type' => $ibforums->input['Privacy'] ? 1 : 0 - ) ); - - $db_query = "UPDATE ibf_sessions SET $db_string WHERE id='".$ibforums->input['s']."'"; - } - else - { - $session_id = md5( uniqid(microtime()) ); - - // Delete any old sessions with this users IP addy. - - $DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."'"); - - $db_string = $DB->compile_db_insert_string( array ( - 'id' => $session_id, - 'member_name' => $member['name'], - 'member_pass' => "", - 'member_id' => $member['id'], - 'running_time' => time(), - 'member_group' => $member['mgroup'], - 'ip_address' => substr($ibforums->input['IP_ADDRESS'], 0, 50), - 'browser' => substr($HTTP_USER_AGENT, 0, 50), - 'start_session'=> time(), - 'login_type' => $ibforums->input['Privacy'] ? 1 : 0 - ) ); - - $db_query = "INSERT INTO ibf_sessions (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"; - } - - $DB->query( $db_query ); - - //----------------------------------- - // If a bogus reset passy action occured, - // and we managed to log in, we'll assume - // that the user did nothing, so we remove - // this new pass setting. - //----------------------------------- - - if ($member['new_pass'] != "") - { - $DB->query("UPDATE ibf_members SET new_pass='' WHERE id='".$member['id']."'"); - } - - $ibforums->member = $member; - $ibforums->session_id = $session_id; - - if ($ibforums->input['referer'] && ($ibforums->input['act'] != 'Reg')) - { - $url = $ibforums->input['referer']; - $url = preg_replace( "!^\?!" , "" , $url ); - $url = preg_replace( "!s=(\w){32}!", "" , $url ); - $url = preg_replace( "!act=(login|reg|lostpass)!i", "", $url ); - } - - //----------------------------------- - // set our privacy cookie - //----------------------------------- - - if ($ibforums->input['Privacy'] == 1) - { - $std->my_setcookie( "anonlogin", 1 ); - } - - //----------------------------------- - // Redirect them to either the board - // index, or where they came from - //----------------------------------- - - $print->redirect_screen( "{$ibforums->lang[thanks_for_login]} {$ibforums->member['name']}", $url ); - - - } - else - { - $this->log_in_form( 'wrong_name' ); - } - - } - - - - - - - function do_log_out() { - global $std, $ibforums, $DB, $print, $sess, $HTTP_COOKIE_VARS; - - /*if(! $ibforums->member['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'no_guests') ); - }*/ - - // Update the DB - - $DB->query("UPDATE ibf_sessions SET ". - "member_name='',". - "member_id='0',". - "member_pass='',". - "login_type='0' ". - "WHERE id='". $sess->session_id ."'"); - - $DB->query("UPDATE ibf_members SET last_visit='".time()."', last_activity='".time()."' WHERE id='".$ibforums->member['id']."'"); - - // Set some cookies - - $std->my_setcookie( "member_id" , "0" ); - $std->my_setcookie( "pass_hash" , "0" ); - $std->my_setcookie( "anonlogin" , "-1" ); - - if (is_array($HTTP_COOKIE_VARS)) - { - foreach( $HTTP_COOKIE_VARS as $cookie => $value ) - { - if (preg_match( "/^(".$ibforums->vars['cookie_id']."fread.*$)/", $cookie, $match)) - { - $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-1', -1 ); - } - - if (preg_match( "/^(".$ibforums->vars['cookie_id']."ibforum.*$)/i", $cookie, $match)) - { - $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-', -1 ); - } - } - } - - // Redirect... - - $print->redirect_screen( $ibforums->lang['thanks_for_logout'], "" ); - - } - - - - - -} - -?> + Log in / log out module +| > Module written by Matt Mecham +| > Date started: 14th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Login; + +class Login { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $login_html = ""; + + function Login() { + global $ibforums, $DB, $std, $print; + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_login', $ibforums->lang_id); + + $this->login_html = $std->load_template('skin_login'); + + + // Are we enforcing log ins? + + if ($ibforums->vars['force_login'] == 1) + { + $msg = 'admin_force_log_in'; + } + else + { + $msg = ""; + } + + // What to do? + + switch($ibforums->input['CODE']) { + case '01': + $this->do_log_in(); + break; + case '02': + $this->log_in_form(); + break; + case '03': + $this->do_log_out(); + break; + + case '04': + $this->markforum(); + break; + + case '05': + $this->markboard(); + break; + + case '06': + $this->delete_cookies(); + break; + + case 'autologin': + $this->auto_login(); + break; + + default: + $this->log_in_form($msg); + break; + } + + // If we have any HTML to print, do so... + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + function auto_login() + { + global $ibforums, $DB, $std, $print; + + // Universal routine. + // If we have cookies / session created, simply return to the index screen + // If not, return to the log in form + + $true_words = $ibforums->lang['logged_in']; + $false_words = $ibforums->lang['not_logged_in']; + $method = 'no_show'; + + if ($ibforums->input['fromreg'] == 1) + { + $true_words = $ibforums->lang['reg_log_in']; + $false_words = $ibforums->lang['reg_not_log_in']; + $method = 'show'; + } + + if ($ibforums->member['id']) + { + if ($method == 'show') + { + $print->redirect_screen( $true_words, "" ); + } + else + { + $std->boink_it($ibforums->base_url); + } + } + else + { + if ($method == 'show') + { + $print->redirect_screen( $false_words, 'act=Login&CODE=00' ); + } + else + { + $std->boink_it($ibforums->base_url.'&act=Login&CODE=00'); + } + } + + + } + + + + function delete_cookies() + { + global $ibforums, $DB, $std, $HTTP_COOKIE_VARS; + + if (is_array($HTTP_COOKIE_VARS)) + { + foreach( $HTTP_COOKIE_VARS as $cookie => $value) + { + if (preg_match( "/^(".$ibforums->vars['cookie_id']."fread.*$)/", $cookie, $match)) + { + $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-1', -1 ); + } + + if (preg_match( "/^(".$ibforums->vars['cookie_id']."ibforum.*$)/i", $cookie, $match)) + { + $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-', -1 ); + } + } + } + + $std->my_setcookie('pass_hash' , '-1'); + $std->my_setcookie('member_id' , '-1'); + $std->my_setcookie('session_id', '-1'); + $std->my_setcookie('topicsread', '-1'); + $std->my_setcookie('anonlogin' , '-1'); + + $std->boink_it($ibforums->base_url); + exit(); + } + + + function markboard() + { + global $ibforums, $DB, $std; + + if(! $ibforums->member['id']) + { + $std->Error( array( LEVEL => 1, MSG => 'no_guests') ); + } + + $DB->query("UPDATE ibf_members SET last_visit='".time()."', last_activity='".time()."' WHERE id='".$ibforums->member['id']."'"); + + $std->boink_it($ibforums->base_url); + exit(); + } + + + function markforum() { + global $ibforums, $DB, $std; + + $ibforums->input['f'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['f'] ); + + if ($ibforums->input['f'] == "") + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files' ) ); + } + + $std->my_setcookie( "fread_".$ibforums->input['f'], time() ); + + $std->boink_it($ibforums->base_url); + exit(); + + } + + + + + function log_in_form($message="") { + global $ibforums, $DB, $std, $print, $HTTP_REFERER; + + //+-------------------------------------------- + //| Are they banned? + //+-------------------------------------------- + + if ($ibforums->vars['ban_ip']) + { + $ips = explode( "|", $ibforums->vars['ban_ip'] ); + foreach ($ips as $ip) + { + $ip = preg_replace( "/\*/", '.*' , $ip ); + if (preg_match( "/$ip/", $ibforums->input['IP_ADDRESS'] )) + { + $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); + } + } + } + + //+-------------------------------------------- + + if ($message != "") + { + $message = $ibforums->lang[ $message ]; + $message = preg_replace( "/<#NAME#>/", "{$ibforums->input[UserName]}", $message ); + + $this->output .= $this->login_html->errors($message); + } + + $this->output .= $this->login_html->ShowForm( $ibforums->lang['please_log_in'], $HTTP_REFERER ); + + $this->nav = array( $ibforums->lang['log_in'] ); + $this->page_title = $ibforums->lang['log_in']; + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + exit(); + + } + + //+-------------------------------------------- + + function do_log_in() { + global $DB, $ibforums, $std, $print, $sess, $HTTP_USER_AGENT, $HTTP_POST_VARS; + + $url = ""; + + //------------------------------------------------- + // Make sure the username and password were entered + //------------------------------------------------- + + if ($HTTP_POST_VARS['UserName'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); + } + + if ($HTTP_POST_VARS['PassWord'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'pass_blank' ) ); + } + + + //------------------------------------------------- + // Check for input length + //------------------------------------------------- + + if (strlen($ibforums->input['UserName']) > 32) + { + $std->Error( array( LEVEL => 1, MSG => 'username_long' ) ); + } + + if (strlen($ibforums->input['PassWord']) > 32) + { + $std->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) ); + } + + $username = strtolower($ibforums->input['UserName']); + $password = md5( $ibforums->input['PassWord'] ); + + //------------------------------------------------- + // Attempt to get the user details + //------------------------------------------------- + + $DB->query("SELECT id, name, mgroup, password, new_pass FROM ibf_members WHERE LOWER(name)='$username'"); + + if ($DB->get_num_rows()) + { + $member = $DB->fetch_row(); + + if ( empty($member['id']) or ($member['id'] == "") ) + { + $this->log_in_form( 'wrong_name' ); + } + + if ($member['password'] != $password) + { + $this->log_in_form( 'wrong_pass' ); + } + + //------------------------------ + + if ($ibforums->input['CookieDate']) + { + $std->my_setcookie("member_id" , $member['id'], 1); + $std->my_setcookie("pass_hash" , $password, 1); + } + + //------------------------------ + + if ($ibforums->input['s']) + { + $session_id = $ibforums->input['s']; + + // Delete any old sessions with this users IP addy that doesn't match our + // session ID. + + $DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."' AND id <> '$session_id'"); + + $db_string = $DB->compile_db_update_string( array ( + 'member_name' => $member['name'], + 'member_id' => $member['id'], + 'running_time' => time(), + 'member_group' => $member['mgroup'], + 'login_type' => $ibforums->input['Privacy'] ? 1 : 0 + ) ); + + $db_query = "UPDATE ibf_sessions SET $db_string WHERE id='".$ibforums->input['s']."'"; + } + else + { + $session_id = md5( uniqid(microtime()) ); + + // Delete any old sessions with this users IP addy. + + $DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."'"); + + $db_string = $DB->compile_db_insert_string( array ( + 'id' => $session_id, + 'member_name' => $member['name'], + 'member_id' => $member['id'], + 'running_time' => time(), + 'member_group' => $member['mgroup'], + 'ip_address' => substr($ibforums->input['IP_ADDRESS'], 0, 50), + 'browser' => substr($HTTP_USER_AGENT, 0, 50), + 'login_type' => $ibforums->input['Privacy'] ? 1 : 0 + ) ); + + $db_query = "INSERT INTO ibf_sessions (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"; + } + + $DB->query( $db_query ); + + //----------------------------------- + // If a bogus reset passy action occured, + // and we managed to log in, we'll assume + // that the user did nothing, so we remove + // this new pass setting. + //----------------------------------- + + if ($member['new_pass'] != "") + { + $DB->query("UPDATE ibf_members SET new_pass='' WHERE id='".$member['id']."'"); + } + + $ibforums->member = $member; + $ibforums->session_id = $session_id; + + if ($ibforums->input['referer'] && ($ibforums->input['act'] != 'Reg')) + { + $url = $ibforums->input['referer']; + $url = str_replace( "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}", "", $url ); + $url = preg_replace( "!^\?!" , "" , $url ); + $url = preg_replace( "!s=(\w){32}!", "" , $url ); + $url = preg_replace( "!act=(login|reg|lostpass)!i", "", $url ); + } + + //----------------------------------- + // set our privacy cookie + //----------------------------------- + + if ($ibforums->input['Privacy'] == 1) + { + $std->my_setcookie( "anonlogin", 1 ); + } + + //----------------------------------- + // Redirect them to either the board + // index, or where they came from + //----------------------------------- + + $print->redirect_screen( "{$ibforums->lang[thanks_for_login]} {$ibforums->member['name']}", $url ); + + + } + else + { + $this->log_in_form( 'wrong_name' ); + } + + } + + + + + + + function do_log_out() { + global $std, $ibforums, $DB, $print, $sess, $HTTP_COOKIE_VARS; + + /*if(! $ibforums->member['id']) + { + $std->Error( array( LEVEL => 1, MSG => 'no_guests') ); + }*/ + + // Update the DB + + $DB->query("UPDATE ibf_sessions SET ". + "member_name='',". + "member_id='0',". + "login_type='0' ". + "WHERE id='". $sess->session_id ."'"); + + $DB->query("UPDATE ibf_members SET last_visit='".time()."', last_activity='".time()."' WHERE id='".$ibforums->member['id']."'"); + + // Set some cookies + + $std->my_setcookie( "member_id" , "0" ); + $std->my_setcookie( "pass_hash" , "0" ); + $std->my_setcookie( "anonlogin" , "-1" ); + + if (is_array($HTTP_COOKIE_VARS)) + { + foreach( $HTTP_COOKIE_VARS as $cookie => $value ) + { + if (preg_match( "/^(".$ibforums->vars['cookie_id']."fread.*$)/", $cookie, $match)) + { + $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-1', -1 ); + } + + if (preg_match( "/^(".$ibforums->vars['cookie_id']."ibforum.*$)/i", $cookie, $match)) + { + $std->my_setcookie( str_replace( $ibforums->vars['cookie_id'], "", $match[0] ) , '-', -1 ); + } + } + } + + // Redirect... + + $print->redirect_screen( $ibforums->lang['thanks_for_logout'], "" ); + + } + + + + + +} + +?> diff --git a/upload/sources/Memberlist.php b/upload/sources/Memberlist.php index fa6d37ac..18be7d72 100644 --- a/upload/sources/Memberlist.php +++ b/upload/sources/Memberlist.php @@ -1,290 +1,343 @@ - Show all the members -| > Module written by Matt Mecham -| > Date started: 20th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Memberlist; - -class Memberlist { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $html = ""; - var $base_url = ""; - - var $first = 0; - var $max_results = 10; - var $sort_key = 'name'; - var $sort_order = 'asc'; - var $filter = 'ALL'; - - var $mem_titles = array(); - var $mem_groups = array(); - - - function Memberlist() { - global $ibforums, $DB, $std, $print; - - - if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 'listall'; - - //-------------------------------------------- - // Require the HTML and language modules - //-------------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_mlist', $ibforums->lang_id ); - - require "./Skin/".$ibforums->skin_id."/skin_mlist.php"; - - $this->html = new skin_mlist(); - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - if ($ibforums->member['g_mem_info'] != 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); - } - - //-------------------------------------------- - // Get the member groups, member titles stuff - //-------------------------------------------- - - $DB->query("SELECT g_title, g_id, g_icon from ibf_groups ORDER BY g_title"); - - while ($row = $DB->fetch_row() ) - { - $this->mem_groups[ $row['g_id'] ] = array( 'TITLE' => $row['g_title'], - 'ICON' => $row['g_icon'], - ); - } - - unset($row); - - $DB->free_result(); - - $DB->query("SELECT title, id, posts, pips from ibf_titles ORDER BY posts DESC"); - - while ($row = $DB->fetch_row() ) - { - $this->mem_titles[ $row['id'] ] = array( 'TITLE' => $row['title'], - 'POSTS' => $row['posts'], - 'PIPS' => $row['pips'], - - ); - } - - unset($row); - - $DB->free_result(); - - $the_filter = array( 'ALL' => $ibforums->lang['show_all'] ); - - foreach($this->mem_groups as $id => $data) - { - if ($id == $ibforums->vars['guest_group']) continue; - if ($id == $ibforums->vars['auth_group']) continue; - if ($id == $ibforums->vars['ban_group']) continue; - $the_filter[$id] = $data['TITLE']; - } - - if (isset($ibforums->input['st'])) $this->first = $ibforums->input['st']; - if (isset($ibforums->input['max_results'])) $this->max_results = $ibforums->input['max_results']; - if (isset($ibforums->input['sort_key'])) $this->sort_key = $ibforums->input['sort_key']; - if (isset($ibforums->input['sort_order'])) $this->sort_order = $ibforums->input['sort_order']; - if (isset($ibforums->input['filter'])) $this->filter = $ibforums->input['filter']; - - $the_sort_key = array( 'name' => 'sort_by_name', - 'posts' => 'sort_by_posts', - 'joined' => 'sort_by_joined', - ); - - $the_max_results = array( 10 => '10', - 20 => '20', - 30 => '30', - 40 => '40', - 50 => '50', - ); - - $the_sort_order = array( 'desc' => 'descending_order', - 'asc' => 'ascending_order', - ); - - $filter_html = "\n"; - $max_results_html = "\n"; - - foreach ($the_sort_order as $k => $v) { - $sort_order_html .= $k == $this->sort_order ? "", $this->jump_html ); - - $this->output .= $this->html->archive_form( $this->jump_html ); - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - } - - function do_archive() { - global $ibforums, $DB, $std, $print; - - require "./sources/lib/emailer.php"; - - $this->email = new emailer(); - - //---------------------------------------- - // Did we specify a folder, or choose all? - //---------------------------------------- - - $folder_query = ""; - $msg_ids = array(); - - if ($ibforums->input['VID'] != 'all') - { - $folder_query = " AND vid='".$ibforums->input['VID']."'"; - } - - if ( $ibforums->input['dateline'] == 'all' ) - { - $time_cut = 0; - } - else - { - $time_cut = time() - ($ibforums->input['dateline'] * 60 * 60 *24); - } - - //---------------------------------------- - // Check the input... - //---------------------------------------- - - $ibforums->input['number'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['number'] ); - - if ($ibforums->input['number'] < 5) - { - $ibforums->input['number'] = 5; - } - - if ($ibforums->input['number'] > 50) - { - $ibforums->input['number'] = 50; - } - - $type = 'html'; - $file_name = "pm_archive.html"; - $ctype = "text/html"; - - if ($ibforums->input['type'] == 'xls') - { - $type = 'xls'; - $file_name = "xls_importable.txt"; - $ctype = "text/plain"; - } - - $output = ""; - - //---------------------------------------- - // Start the datafile.. - //---------------------------------------- - - if ($type == 'html') - { - $output .= $this->html->archive_html_header(); - } - - require "./sources/lib/post_parser.php"; - - $this->parser = new post_parser(); - - //---------------------------------------- - // Get the messages... - //---------------------------------------- - - $archive_query = $DB->query("SELECT mg.*, m.name, m.id from ibf_messages mg, ibf_members m WHERE mg.member_id=m.id AND mg.member_id='".$this->member['id']."' AND mg.msg_date > $time_cut".$folder_query." ORDER BY mg.msg_date LIMIT 0,".$ibforums->input['number']); - - if ( $DB->get_num_rows($archive_query) ) - { - while ( $r = $DB->fetch_row($archive_query) ) - { - $info = array(); - - $msg_ids[] = $r['msg_id']; - - $from_member = $DB->query("SELECT id, name FROM ibf_members WHERE id='".$r['from_id']."'"); - - $from_mem = $DB->fetch_row($from_member); - - $info['msg_date'] = $std->get_date( $r['msg_date'], 'LONG' ); - $info['msg_title'] = $r['title']; - $info['msg_sender'] = $from_mem['name']; - $info['msg_content'] = $this->parser->convert( array( 'TEXT' => $r['message'], - 'SMILIES' => 0, - 'CODE' => $ibforums->vars['msg_allow_code'], - 'HTML' => $ibforums->vars['msg_allow_html'] - ) - ); - - if ($type == 'xls') - { - $output .= '"'.$this->strip_quotes($info['msg_title']).'","'.$this->strip_quotes($info['msg_date']).'","'.$this->strip_quotes($info['msg_sender']).'","'.$this->strip_quotes($info['msg_content']).'"'."\r"; - } - else - { - $output .= $this->html->archive_html_entry($info); - } - - } - - if ($type == 'html') - { - $output .= $this->html->archive_html_footer(); - } - - $num_msg = count( $msg_ids ); - - if ($ibforums->input['delete'] == 'yes') - { - $msg_str = implode( ",", $msg_ids ); - - if (!empty($msg_str)) - { - $DB->query("DELETE FROM ibf_messages WHERE msg_id IN ($msg_str)"); - - $DB->query("UPDATE ibf_members SET msg_total=msg_total-$num_msg WHERE id ='".$this->member['id']."'"); - } - - } - - $this->email->get_template("pm_archive"); - - $this->email->build_message( array( - 'NAME' => $this->member['name'], - ) - ); - - $this->email->subject = $ibforums->lang['arc_email_subject']; - $this->email->to = $this->member['email']; - $this->email->add_attachment( $output, $file_name, $ctype ); - $this->email->send_mail(); - - - $ibforums->lang['arc_complete'] = preg_replace( "/<#NUM#>/", "$num_msg", $ibforums->lang['arc_complete'] ); - - $this->output .= $this->html->archive_complete(); - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_archive_messages' ) ); - } - - - } - - function strip_quotes($text) { - - return preg_replace( "/\"/", '\\\"', $text ); - - } - - /**********************************************************/ - // PREFS: - // - // Create/delete/edit messenger folders - /**********************************************************/ - - function prefs() { - global $ibforums, $DB, $std, $print; - - $this->output .= $this->html->prefs_header(); - - $count = 0; - - foreach( $this->msg_stats['dir_data'] as $k => $v ) - { - $extra = ""; - if ($v['id'] == 'in' or $v['id'] == 'sent') - { - $extra = "  ( ".$v['real']." - ".$ibforums->lang['cannot_remove']." )"; - } - $this->output .= $this->html->prefs_row( array( 'ID' => $v['id'], 'REAL' => $v['real'], 'EXTRA' => $extra ) ); - $count++; - } - - $this->output .= $this->html->prefs_add_dirs(); - - for ($i = $count; $i < $count+3; $i++) - { - $this->output .= $this->html->prefs_row( array( 'ID' => 'dir_'.$i, 'REAL' => '', 'EXTRA' => '' ) ); - } - - $this->output .= $this->html->prefs_footer(); - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - } - - function do_prefs() { - global $ibforums, $DB, $std, $print; - - // Check to ensure than we've not tried to remove the inbox and sent items directories. - - if ( ($ibforums->input['sent'] == "") or ($ibforums->input['in'] == "") ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cannot_remove_dir' ) ); - } - - - $v_dir = 'in:'.$ibforums->input['in'].'|sent:'.$ibforums->input['sent']; - - // Fetch the rest of the dirs - - - $ids = array(); - - foreach ($ibforums->input as $key => $value) - { - if ( preg_match( "/^dir_(\d+)$/", $key, $match ) ) - { - if ($ibforums->input[$match[0]]) - { - $v_dir .= '|'.$match[0].':'.trim($ibforums->input[$match[0]]); - } - } - } - - $DB->query("UPDATE ibf_members SET vdirs='$v_dir' WHERE id='".$this->member['id']."'"); - - $std->boink_it($ibforums->base_url."&act=Msg&CODE=07"); - exit; - - } - - /**********************************************************/ - // DELETE_MEMBER: - // - // Removes a member from address book. - /**********************************************************/ - - function del_member() { - global $ibforums, $DB, $std, $print; - - if (!$ibforums->input['MID']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - $DB->query("DELETE FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); - - $std->boink_it($this->base_url."&act=Msg&CODE=02"); - exit; - } - - /**********************************************************/ - // EDIT_MEMBER: - // - // Edit a member from address book. - /**********************************************************/ - - function edit_member() { - global $ibforums, $DB, $std, $print; - - if (!$ibforums->input['MID']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - - $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); - $memb = $DB->fetch_row(); - - if (!$memb['contact_id']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - $html = ""; - - $this->output .= $this->html->address_edit( array( 'SELECT' => $html, 'MEMBER' => $memb ) ); - - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."", - "".$ibforums->lang['t_book']."" ); - - } - - /**********************************************************/ - // DO_EDIT_MEMBER: - // - // Edit a member from address book. - /**********************************************************/ - - function do_edit() { - global $ibforums, $DB, $std, $print; - - if (!$ibforums->input['MID']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - $ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == 'yes' ? 1 : 0; - - $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); - $memb = $DB->fetch_row(); - - if (!$memb['contact_id']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - $DB->query("UPDATE ibf_contacts SET contact_desc='".$ibforums->input['mem_desc']."', allow_msg='".$ibforums->input['allow_msg']."' WHERE id='".$memb['id']."'"); - - $std->boink_it($this->base_url."&act=Msg&CODE=02"); - exit; - - } - - - - /**********************************************************/ - // CONTACT: - // - // Shows the address book. - /**********************************************************/ - - function contact() { - global $ibforums, $DB, $std, $print; - - $this->output .= $this->html->Address_header(); - - $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' ORDER BY contact_name ASC"); - - if ( $DB->get_num_rows() ) - { - - $this->output .= $this->html->Address_table_header(); - while ( $row = $DB->fetch_row() ) - { - $row['text'] = $row['allow_msg'] - ? $ibforums->lang['can_contact'] - : $ibforums->lang['cannot_contact']; - - $this->output .= $this->html->render_address_row($row); - } - $this->output .= $this->html->end_address_table(); - - } - else - { - $this->output .= $this->html->Address_none(); - - } - - // Do we have a name to enter? - - $name_to_enter = ""; - - if ($ibforums->input['MID']) - { - if ( preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) - { - $DB->query("SELECT name, id FROM ibf_members WHERE id='".$ibforums->input['MID']."'"); - $memb = $DB->fetch_row(); - - if ($memb['id']) - { - $name_to_enter = $memb['name']; - } - } - } - - $this->output .= $this->html->address_add($name_to_enter); - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - } - - - /**********************************************************/ - // ADD MEMBER: - // - // Adds a member to the addy book. - /**********************************************************/ - - function add_member() { - global $ibforums, $DB, $std, $print; - - if (! $ibforums->input['mem_name']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - $DB->query("SELECT name, id FROM ibf_members WHERE LOWER(name)='".$ibforums->input['mem_name']."'"); - $memb = $DB->fetch_row(); - - if (! $memb['id']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); - } - - //-------------------------------------- - // Do we already have this member in our - // address book? - //-------------------------------------- - - $DB->query("SELECT contact_id FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$memb['id']."'"); - - if ( $DB->get_num_rows() ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'member_in_add_book' ) ); - } - - //-------------------------------------- - // Insert it into the DB - //-------------------------------------- - - $ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == 'yes' ? 1 : 0; - - $db_string = $std->compile_db_string( array( - 'member_id' => $this->member['id'], - 'contact_name' => $memb['name'], - 'allow_msg' => $ibforums->input['allow_msg'], - 'contact_desc' => $ibforums->input['mem_desc'], - 'contact_id' => $memb['id'] - ) ); - - $DB->query("INSERT INTO ibf_contacts (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - unset($db_string); - - // BUH BYE! - - $std->boink_it($this->base_url."&act=Msg&CODE=02"); - exit; - } - - - - /********************************************************************************************************************/ - // Mutli Act: - // - // Removes or moves messages. - /**********************************************************/ - - function multi_act() { - global $ibforums, $DB, $std, $print; - - //-------------------------------------- - // Get the ID's to delete - //-------------------------------------- - - $ids = array(); - - foreach ($ibforums->input as $key => $value) - { - if ( preg_match( "/^msgid-(\d+)$/", $key, $match ) ) - { - if ($ibforums->input[$match[0]]) - { - $ids[] = $match[1]; - } - } - } - - $affected_ids = count($ids); - - if ( $affected_ids > 0 ) - { - $id_string = implode( ",", $ids ); - - if ($ibforums->input['delete']) - { - $DB->query("DELETE FROM ibf_messages WHERE member_id='".$this->member['id']."' AND msg_id IN ($id_string)"); - $DB->query("UPDATE ibf_members SET msg_total=msg_total-$affected_ids WHERE id='".$this->member['id']."'"); - $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); - exit; - - } - else if ($ibforums->input['move']) - { - $DB->query("UPDATE ibf_messages SET vid='".$this->vid."' WHERE member_id='".$this->member['id']."' AND msg_id IN ($id_string)"); - $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); - exit; - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); - } - } - else - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); - } - - } - - - - /**********************************************************/ - // DELETE MESSAGE: - // - // Removes a message. - // Yes. there is no small print. - /**********************************************************/ - - function delete() { - global $ibforums, $DB, $std, $print; - - //-------------------------------------- - // check for a msg ID - //-------------------------------------- - - if (!$ibforums->input['MSID']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); - } - - if (! preg_match( "/^\d+$/" , $ibforums->input['MSID'] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) ); - } - - //-------------------------------------- - // Delete it from the DB - //-------------------------------------- - - $DB->query("DELETE FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' AND member_id='".$this->member['id']."'"); - - $DB->query("UPDATE ibf_members SET msg_total=msg_total-1 WHERE id='".$this->member['id']."'"); - - // BYE! - - $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); - exit; - } - - - /**********************************************************/ - // VIEW MESSAGE: - // - // Views a message, thats it. No, it doesn't do anything else - // I don't know why. It just does. Accept it and move on dude. - /**********************************************************/ - - function view_msg() { - global $ibforums, $DB, $std, $print; - - //-------------------------------------- - // check for a msg ID - //-------------------------------------- - - if (!$ibforums->input['MSID']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_msg' ) ); - } - - if (! preg_match( "/^\d+$/" , $ibforums->input['MSID'] ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) ); - } - - //-------------------------------------- - // Get the message from the DB - // Check to make sure it exists - //-------------------------------------- - - $DB->query("SELECT * FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."'"); - $msg = $DB->fetch_row(); - - if (!$msg['msg_id']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_msg' ) ); - } - - //-------------------------------------- - // Are we tracking this message? - //-------------------------------------- - - if ($msg['read_state'] == -1) - { - - $r_time = $std->get_date( $msg['msg_date'], 'LONG' ); - $r_post = "{$ibforums->lang['read_rec_text']} $r_time
    {$msg['message']}

    {$this->member['name']} {$ibforums->lang['mem_read_msg']}"; - - $db_string = $std->compile_db_string( array( - 'member_id' => $msg['from_id'], - 'msg_date' => time(), - 'read_state' => 0, - 'title' => $ibforums->lang['read_rec_title'].' '.$msg['title'], - 'message' => $r_post, - 'from_id' => $this->member['id'], - 'vid' => 'in', - 'recipient_id' => 'N/A', - ) ); - - $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - $new_id = $DB->get_insert_id(); - unset($db_string); - - //----------------------------------------------------- - - $DB->query("UPDATE ibf_members SET ". - "msg_total = msg_total + 1, ". - "new_msg = new_msg + 1, ". - "msg_from_id='" .$this->member['id'] . "', ". - "msg_msg_id='" . $new_id . "' ". - "WHERE id='" . $msg['from_id'] . "'"); - - } - - //-------------------------------------- - // Is this an unread message? - //-------------------------------------- - - if ($msg['read_state'] < 1) - { - $DB->query("UPDATE ibf_messages SET read_state='1' WHERE msg_id='".$ibforums->input['MSID']."'"); - } - - - //-------------------------------------- - // Start formatting the member and msg - //-------------------------------------- - - require "./sources/lib/post_parser.php"; - - $this->parser = new post_parser(); - - - $msg['msg_date'] = $std->get_date( $msg['msg_date'], 'LONG' ); - - - $DB->query("SELECT g.g_title as member_group, m.id, m.joined, m.name, m.title, m.posts, m.mgroup, m.email, m.signature, m.avatar, m.avatar_size, m.hide_email, m.aim_name, m.icq_number ". - "FROM ibf_members m, ibf_groups g WHERE id='".$msg['from_id']."' and g.g_id=m.mgroup"); - - $member = $DB->fetch_row(); - - $member = $this->parse_member( $member, $msg ); - - $msg['message'] = $this->parser->convert( array( TEXT => $msg['message'], - SMILIES => 1, - CODE => $ibforums->vars['msg_allow_code'], - HTML => $ibforums->vars['msg_allow_html'] - ) - ); - - if (!$ibforums->vars[SIG_SEP]) $ibforums->vars[SIG_SEP] = "

    --------------------
    "; - - if ($this->member['view_sigs']) - { - $member['signature'] = $ibforums->vars[SIG_SEP] . $this->parser->convert( array( TEXT => $member['signature'], - SMILIES => 0, - CODE => $ibforums->vars['sig_allow_ibc'], - HTML => $ibforums->vars['sig_allow_html'], - SIGNATURE => 1, - ) - ); - } - else - { - $member['signature'] = ""; - } - - $member['VID'] = $this->msg_stats['current_id']; - - $this->output .= $this->html->Render_msg( array( - 'msg' => $msg, - 'member' => $member, - 'jump' => $this->jump_html - ) ); - - - $this->page_title = $ibforums->lang['t_welcome']; - - $this->nav = array( "".$ibforums->lang['t_title']."", - "".$this->msg_stats['current_dir']."" - ); - - } - - /**********************************************************/ - // SEND MESSAGE: - // - // Sends a message. Yes, it's that simple. Why so much code? - // Because typing "send a message to member X" doesnt actually - // do anything. - /**********************************************************/ - - function send() { - global $ibforums; - - $ibforums->input['MODE'] ? $this->send_msg() : $this->send_form(); - - } - - //+----------------------------------------------------------- - - function send_form($preview=0) { - global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; - - //-------------------------------------- - // Get some more HTML and words, oh yes. - //-------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); - - require "./Skin/".$ibforums->skin_id."/skin_post.php"; - $post_html = new skin_post(); - - if ($preview == 1) - { - - require "./sources/lib/post_parser.php"; - - $this->parser = new post_parser(); - - $old_msg = $this->parser->convert( array( TEXT => $ibforums->input['Post'], - SMILIES => 1, - CODE => $ibforums->vars['msg_allow_code'], - HTML => $ibforums->vars['msg_allow_html'] - ) - ); - - $this->output .= $this->html->preview($old_msg); - - } - - //-------------------------------------- - // Load the contacts - //-------------------------------------- - - $contacts = ""; - - $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' ORDER BY contact_name"); - - if ( $DB->get_num_rows() ) - { - $contacts = "\n"; - } - else - { - $contacts = $ibforums->lang['address_list_empty']; - } - - $this->html->class['LANG']['max_msg'] = preg_replace( "/<#MAX_MSG_SIZE#>/", $ibforums->vars['MAX_MSG_SIZE'], $this->html->class['LANG']['max_msg'] ); - $this->html->class['LANG']['the_max_msg'] = $ibforums->vars['MAX_MSG_SIZE'] * 1024; - - $name_to_enter = ""; - $old_message = ""; - $old_title = ""; - - //-------------------------------------- - // Did we come from a button with a user ID? - //-------------------------------------- - - if (!empty($ibforums->input['MID'])) - { - $DB->query("SELECT name, id FROM ibf_members WHERE id='".$ibforums->input['MID']."'"); - $name = $DB->fetch_row(); - - if ($name['id']) - { - $name_to_enter = $name['name']; - } - } - - //-------------------------------------- - // Are we quoting an old message? - //-------------------------------------- - - if ($preview == 1) - { - $old_message = stripslashes($HTTP_POST_VARS['Post']); - $old_title = preg_replace( "/'/", "'", stripslashes($HTTP_POST_VARS['msg_title']) ); - - } - else if (!empty($ibforums->input['MSID'])) - { - $DB->query("SELECT message, title from ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."'"); - $old_msg = $DB->fetch_row(); - if ($old_msg['title']) - { - $old_message = '[QUOTE]'.$old_msg['message'].'[/QUOTE]'."\n"; - $old_message = preg_replace( "/
    /", "\n", $old_message ); - $old_title = "Re:".$old_msg['title']; - $old_title = preg_replace( "/^(?:Re\:){1,}/i", "Re:", $old_title ); - } - } - - - //-------------------------------------- - // Build up the HTML for the send form - //-------------------------------------- - - $this->output .= $this->html->Send_form( array ( - 'CONTACTS' => $contacts, - 'MEMBER' => $this->member, - 'N_ENTER' => $name_to_enter, - 'O_TITLE' => $old_title, - ) ); - - $post_html->class['LANG']['the_max_length'] = $ibforums->vars['MAX_MSG_SIZE'] * 1024; - $post_html->class['LANG']['ib_state'] = $ibforums->vars['MSG_ALLOW_CODE'] ? $post_html->class['LANG']['ib_on'] : $post_html->class['LANG']['ib_off']; - $post_html->class['LANG']['html_state'] = $ibforums->vars['MSG_ALLOW_HTML'] ? $post_html->class['LANG']['html_on'] : $post_html->class['LANG']['html_off']; - - $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; - - $this->output .= $post_html->postbox_buttons($old_message); - - $this->output .= $this->html->send_form_footer(); - - //-------------------------------------- - // Add in the smilies box - //-------------------------------------- - - $show_table = 0; - $count = 0; - $smilies = "\n"; - - // Get the smilies from the DB - - $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); - - while ($elmo = $DB->fetch_row() ) { - - $show_table++; - $count++; - - $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; - - if ($count == $ibforums->vars['emo_per_row']) { - $smilies .= "\n\n"; - $count = 0; - } - } - - if ($count != $ibforums->vars['emo_per_row']) { - for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { - $smilies .= " \n"; - } - $smilies .= ""; - } - - $table = $post_html->smilie_table(); - - if ($show_table != 0) { - $table = preg_replace( "//", $smilies, $table ); - $this->output = preg_replace( "//", $table, $this->output ); - } - - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - - } - - - - - - //+----------------------------------------------------------- - - - - - - function send_msg() { - global $ibforums, $DB, $std, $print; - - $ibforums->input['from_contact'] = $ibforums->input['from_contact'] ? $ibforums->input['from_contact'] : '-'; - - //---------------------------------------------------------------- - if ( strlen($ibforums->input['msg_title']) < 2 ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_title' ) ); - } - //---------------------------------------------------------------- - if ( strlen($ibforums->input['Post']) < 2 ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg' ) ); - } - //---------------------------------------------------------------- - if ($ibforums->input['from_contact'] == '-' and $ibforums->input['entered_name'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_chosen_member' ) ); - } - //---------------------------------------------------------------- - - //-------------------------------------- - // Attempt to get the reciepient details - //-------------------------------------- - - $to_member = array(); - - if ($ibforums->input['from_contact'] == '-') - { - $query = "LOWER(name)='".$ibforums->input['entered_name']."'"; - } - else - { - $query = "id='".$ibforums->input['from_contact']."'"; - } - - $DB->query("SELECT name, id, view_pop, mgroup FROM ibf_members WHERE ".$query); - $to_member = $DB->fetch_row(); - - if (empty($to_member['id'])) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_to_member' ) ); - } - - //-------------------------------------- - // Can the reciepient use the PM system? - //-------------------------------------- - - $DB->query("SELECT g_use_pm FROM ibf_groups WHERE g_id='".$to_member['mgroup']."'"); - $allow = $DB->fetch_row(); - - if ($allow['g_use_pm'] != 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_usepm_member' ) ); - } - - //-------------------------------------- - // Has the reciepient blocked us? - //-------------------------------------- - - $DB->query("SELECT contact_id, allow_msg FROM ibf_contacts WHERE contact_id='".$this->member['id']."' AND member_id='".$to_member['id']."'"); - $can_msg = $DB->fetch_row(); - - if ( (isset($can_msg['contact_id'])) and ($can_msg['allow_msg'] != 1) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'msg_blocked' ) ); - } - - //-------------------------------------- - // Do we have enough room to store a - // saved copy? - //-------------------------------------- - - if ($ibforums->input['add_sent'] and $ibforums->vars['max_messages']) - { - if ( ($this->msg_stats['msg_total'] + 1) >= $ibforums->vars['max_messages'] ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'max_message_from' ) ); - } - } - - //-------------------------------------- - // Is this a preview? - //-------------------------------------- - - if ($ibforums->input['preview'] != "") - { - $ibforums->input['MID'] = $to_member['id']; - $this->send_form(1); - return; - } - - //-------------------------------------- - // Sort out tracking and pop us status - //-------------------------------------- - - $show_popup = $to_member['view_pop']; - - $track_id = 0; - - if ($ibforums->input['add_tracking']) - { - $track_id = -1; - } - - //-------------------------------------- - // Get the recipient msg_stats - //-------------------------------------- - - $DB->query("SELECT msg_total FROM ibf_members WHERE id='".$to_member['id']."'"); - $to_msg_stats = $DB->fetch_row(); - - //-------------------------------------- - // Does the target member have enough room - // in their inbox for a new message? - //-------------------------------------- - - if ( (($to_msg_stats['msg_total']) >= $ibforums->vars['max_messages']) and ($ibforums->vars['max_messages'] != "") ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'max_message_to' ) ); - } - - //-------------------------------------- - // Enter the info into the DB - // Target user side. - //-------------------------------------- - - $db_string = $std->compile_db_string( array( - 'member_id' => $to_member['id'], - 'msg_date' => time(), - 'read_state' => $track_id, - 'title' => $ibforums->input['msg_title'], - 'message' => $ibforums->input['Post'], - 'from_id' => $this->member['id'], - 'vid' => 'in', - 'recipient_id' => $to_member['id'], - ) ); - - $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - $new_id = $DB->get_insert_id(); - unset($db_string); - - //----------------------------------------------------- - - $DB->query("UPDATE ibf_members SET ". - "msg_total = msg_total + 1, " . - "new_msg = new_msg + 1, " . - "msg_from_id='" .$this->member['id'] . "', ". - "msg_msg_id='" . $new_id . "', ". - "show_popup='" . $show_popup . "' ". - "WHERE id='" . $to_member['id'] . "'"); - - //----------------------------------------------------- - // Add the data to the current members DB if we are - // adding it to our "sent items" folder - //----------------------------------------------------- - - if ($ibforums->input['add_sent']) - { - - $DB->query("UPDATE ibf_members SET ". - "msg_total = msg_total + 1 ". - "WHERE id='" . $this->member['id'] . "'"); - - $db_string = $std->compile_db_string( array( - 'member_id' => $this->member['id'], - 'msg_date' => time(), - 'read_state' => 0, - 'title' => $ibforums->lang['saved_sent_msg'].' '.$ibforums->input['msg_title'], - 'message' => $ibforums->input['Post'], - 'from_id' => $this->member['id'], - 'vid' => 'sent', - 'recipient_id' => $to_member['id'], - ) ); - - - $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - unset($db_string); - } - - $text = preg_replace( "/<#FROM_MEMBER#>/" , $this->member['name'] , $ibforums->lang['sent_text'] ); - $text = preg_replace( "/<#TO_MEMBER#>/" , $to_member['name'] , $text ); - $text = preg_replace( "/<#MESSAGE_TITLE#>/" , $ibforums->input['msg_title'], $text ); - - $print->redirect_screen( $text , "&act=Msg&CODE=01" ); - - } - - - /**********************************************************/ - // MSG LIST: - // - // Views the inbox / folder of choice - /**********************************************************/ - - function msg_list() { - global $ibforums, $DB, $std, $print; - - $sort_key = $ibforums->input['sort_key'] ? $ibforums->input['sort_key'] : 'msg_date'; - $sort_order = $ibforums->input['sort_order'] ? $ibforums->input['sort_order'] : 'Z-A'; - - $sort_order = 'Z-A' ? 'DESC' : 'ASC'; - - //--------------------------------------------- - // Get the number of messages we have in total. - //--------------------------------------------- - - $DB->query("SELECT COUNT(*) as msg_total FROM ibf_messages WHERE member_id='".$this->member['id']."'"); - $total = $DB->fetch_row(); - - $total['msg_total'] = $total['msg_total'] > 0 ? $total['msg_total'] : 0; - - if ($ibforums->member['msg_total'] == "") - { - $DB->query("UPDATE ibf_members SET msg_total='".$total['msg_total']."' WHERE id='".$this->member['id']."'"); - } - - //--------------------------------------------- - // Make sure we've not exceeded our alloted allowance. - //--------------------------------------------- - - $info['full_messenger'] = ""; - $info['full_percent'] = ""; - $info['space_free'] = "Unlimited"; - $info['total_messages'] = $total['msg_total']; - - if ($ibforums->vars['max_messages'] > 0) - { - if ($total['msg_total'] >= $ibforums->vars['max_messages']) - { - $info['full_messenger'] = "".$ibforums->lang['folders_full'].""; - } - - $info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->vars['max_messages']) * 100) ) : 0; - $info['full_percent'] = "(". $info['full_percent'] .'% '. $ibforums->lang['total_capacity'] . ")"; - $info['space_free'] = $ibforums->vars['max_messages'] - $total['msg_total']; - } - - - //--------------------------------------------- - // Print the header - //--------------------------------------------- - - if ($this->vid == 'sent') - { - $ibforums->lang['message_from'] = $ibforums->lang['message_to']; - - $DB->query("SELECT m.*, mp.name as from_name FROM ibf_messages m, ibf_members mp WHERE member_id='".$this->member['id']."' AND vid='".$this->vid."' and mp.id=m.recipient_id ORDER BY $sort_key $sort_order"); - - } - else - { - $DB->query("SELECT m.*, mp.name as from_name FROM ibf_messages m, ibf_members mp WHERE member_id='".$this->member['id']."' AND vid='".$this->vid."' and mp.id=m.from_id ORDER BY $sort_key $sort_order"); - } - - $this->output .= $this->html->inbox_table_header( $this->msg_stats['current_dir'], $info ); - - //--------------------------------------------- - // Get the messages - //--------------------------------------------- - - - if ( $DB->get_num_rows() ) - { - while( $row = $DB->fetch_row() ) - { - $row['icon'] = $row['read_state'] == 1 ? $ibforums->skin['M_READ'] : $ibforums->skin['M_UNREAD']; - $row['date'] = $std->get_date( $row['msg_date'] , 'LONG' ); - - if ($this->vid != 'sent') - { - $row['add_to_contacts'] = "[ vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=02&MID={$row['from_id']}'>{$ibforums->lang[add_to_book]} ]"; - } - else - { - $row['from_id'] = $row['recipient_id']; - } - - $d_array = array( 'msg' => $row, 'member' => $this->member, 'stat' => $this->msg_stats ); - - $this->output .= $this->html->inbox_row( $d_array ); - } - } - else - { - $this->output .= $this->html->No_msg_inbox(); - } - - $sorted_by = 'from_' . $sort_key; - $this->output .= $this->html->end_inbox( $this->jump_html ); - - //--------------------------------------------- - // Update the message stats if we have to - //--------------------------------------------- - - if ($this->msg_stats['current_id'] == 'in') - { - $DB->query("UPDATE ibf_members SET ". - "new_msg='0' ". - "WHERE id='".$this->member['id']."'"); - } - - $this->page_title = $ibforums->lang['t_welcome']; - $this->nav = array( "".$ibforums->lang['t_title']."" ); - - - } - - -//+------------------------------------------------------------------------------------ - - /*********************************************************************/ - // Parse the member info - /*********************************************************************/ - - function parse_member($member=array(), $row=array()) { - global $ibforums, $std, $DB; - - $member['name'] = "{$member['name']}"; - - $member['avatar'] = $std->get_avatar( $member['avatar'], $ibforums->member['view_avs'], $member['avatar_size'] ); - - $member['MEMBER_JOINED'] = $ibforums->lang['m_joined'].' '.$std->get_date( $member['joined'], 'JOINED' ); - - $member['MEMBER_GROUP'] = $ibforums->lang['m_group'].' '.$member['member_group']; - - $member['MEMBER_POSTS'] = $ibforums->lang['m_posts'].' '.$member['posts']; - - $member['PROFILE_ICON'] = "{$ibforums->skin['P_PROFILE']} "; - - $member['MESSAGE_ICON'] = "{$ibforums->skin['P_MSG']} "; - - if (!$member['hide_email']) { - $member['EMAIL_ICON'] = "{$ibforums->skin['P_EMAIL']} "; - } - - if ( $member['website'] and $member['website'] = preg_match( "/^http:\/\/\S+$/", $member['WEBSITE'] ) ) { - $member['WEBSITE_ICON'] = "{$ibforums->skin['P_WEBSITE']} "; - } - - if ($member['icq_number']) { - $member['ICQ_ICON'] = "base_url}&act=ICQ&MID={$member['id']}','Pager','450','330','0','1','1','1')\">{$ibforums->skin[P_ICQ]} "; - } - - if ($member['aim_name']) { - $member['AOL_ICON'] = "base_url}&act=AOL&MID={$member['id']}','Pager','450','330','0','1','1','1')\">{$ibforums->skin[P_AOL]} "; - } - - //----------------------------------------------------- - - return $member; - - } - - - -} - -?> + Messenger functions +| > Module written by Matt Mecham +| > Date started: 26th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Messenger; + +class Messenger { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $html = ""; + var $email = ""; + + var $msg_stats = array(); + var $prefs = ""; + + var $member = array(); + var $m_group = array(); + + var $to_mem = array(); + + var $jump_html = ""; + + var $vid = "in"; + var $mem_groups = array(); + var $mem_titles = array(); + + var $parser = ""; + + var $cp_html = ""; + + function Messenger() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------------- + // Make sure our code number is numerical only + //-------------------------------------------- + + if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00; + + //-------------------------------------------- + // Require the HTML and language modules + //-------------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_msg', $ibforums->lang_id); + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_ucp' , $ibforums->lang_id); + + //-------------------------------------------- + + $this->html = $std->load_template('skin_msg'); + + //-------------------------------------------- + + $this->cp_html = $std->load_template('skin_ucp'); + + //-------------------------------------------- + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}"; + + //-------------------------------------------- + // Check viewing permissions, etc + //-------------------------------------------- + + $this->member = $ibforums->member; + + if (empty($this->member['g_use_pm'])) { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_use_messenger' ) ); + } + + if (empty($this->member['id'])) { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_guests' ) ); + } + + //-------------------------------------------- + // Get the member stats data + //-------------------------------------------- + + $DB->query("SELECT vdirs, msg_total, new_msg, msg_msg_id FROM ibf_members WHERE id='".$this->member['id']."'"); + $this->msg_stats = $DB->fetch_row(); + + //-------------------------------------------- + // Do a little set up, do a litle dance, get + // down tonight! *boogie* + //-------------------------------------------- + + $this->jump_html = "\n\n"; + + + + $print->add_output( $this->cp_html->Menu_bar($this->base_url) );; + + + //-------------------------------------------- + // What to do? + //-------------------------------------------- + + + switch($ibforums->input['CODE']) { + case '01': + $this->msg_list(); + break; + case '02': + $this->contact(); + break; + case '03': + $this->view_msg(); + break; + case '04'; + $this->send(); + break; + case '05': + $this->delete(); + break; + case '06': + $this->multi_act(); + break; + case '07': + $this->prefs(); + break; + case '08': + $this->do_prefs(); + break; + case '09': + $this->add_member(); + break; + case '10': + $this->del_member(); + break; + case '11': + $this->edit_member(); + break; + case '12': + $this->do_edit(); + break; + case '14': + $this->archive(); + break; + case '15': + $this->do_archive(); + break; + case '99': + $this->pm_popup(); + break; + + case '20': + $this->view_saved(); + break; + + case '21': + $this->edit_saved(); + break; + + case '30': + $this->show_tracking(); + break; + + case '31': + $this->end_tracking(); + break; + + case '32': + $this->del_tracked(); + break; + + default: + $this->msg_list(); + break; + } + + // If we have any HTML to print, do so... + + $fj = $std->build_forum_jump(); + $fj = preg_replace( "!#Forum Jump#!", $ibforums->lang['forum_jump'], $fj); + + $this->output .= $this->cp_html->CP_end(); + + $this->output .= $this->cp_html->forum_jump($fj); + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + /**********************************************************/ + // PM Pop up: + // + // Simpy display the pop up window + /**********************************************************/ + + function pm_popup() { + + global $DB, $std, $print, $ibforums; + + // Get the last message stuff + + $DB->query("SELECT m.name, msg.title, msg.msg_date, msg.from_id FROM ibf_members m, ibf_messages msg ". + "WHERE msg.member_id='".$ibforums->member['id']."' AND msg_id='".$this->msg_stats['msg_msg_id']."' ". + "AND m.id=msg.from_id"); + + $row = $DB->fetch_row(); + + // Fix up the text string... + + $row['msg_date'] = $std->get_date( $row['msg_date'], 'LONG' ); + + $text = preg_replace( "/<#NAME#>/" , $row['name'] , $ibforums->lang['pmp_string'] ); + $text = preg_replace( "/<#TITLE#>/", $row['title'] , $text ); + $text = preg_replace( "/<#DATE#>/" , $row['msg_date'], $text ); + + $html = $this->html->pm_popup($text, $this->msg_stats['msg_msg_id']); + + $print->pop_up_window( "PM", $html ); + + } + + + /**********************************************************/ + // ARCHIVE: + // + // Allows a user to archive and email a HTML file + /**********************************************************/ + + function archive() { + global $ibforums, $DB, $std, $print; + + $this->jump_html = preg_replace("//", "", $this->jump_html ); + + $this->output .= $this->html->archive_form( $this->jump_html ); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + } + + function do_archive() { + global $ibforums, $DB, $std, $print; + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + //---------------------------------------- + // Did we specify a folder, or choose all? + //---------------------------------------- + + $folder_query = ""; + $msg_ids = array(); + + if ($ibforums->input['VID'] != 'all') + { + $folder_query = " AND vid='".$ibforums->input['VID']."'"; + } + + if ( $ibforums->input['dateline'] == 'all' ) + { + $time_cut = 0; + } + else + { + $time_cut = time() - ($ibforums->input['dateline'] * 60 * 60 *24); + } + + //---------------------------------------- + // Check the input... + //---------------------------------------- + + $ibforums->input['number'] = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['number'] ); + + if ($ibforums->input['number'] < 5) + { + $ibforums->input['number'] = 5; + } + + if ($ibforums->input['number'] > 50) + { + $ibforums->input['number'] = 50; + } + + $type = 'html'; + $file_name = "pm_archive.html"; + $ctype = "text/html"; + + if ($ibforums->input['type'] == 'xls') + { + $type = 'xls'; + $file_name = "xls_importable.txt"; + $ctype = "text/plain"; + } + + $output = ""; + + //---------------------------------------- + // Start the datafile.. + //---------------------------------------- + + if ($type == 'html') + { + $output .= $this->html->archive_html_header(); + } + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + //---------------------------------------- + // Get the messages... + //---------------------------------------- + + $archive_query = $DB->query("SELECT mg.*, m.name, m.id from ibf_messages mg, ibf_members m WHERE mg.member_id=m.id AND mg.member_id='".$this->member['id']."' AND mg.msg_date > $time_cut".$folder_query." ORDER BY mg.msg_date LIMIT 0,".$ibforums->input['number']); + + if ( $DB->get_num_rows($archive_query) ) + { + while ( $r = $DB->fetch_row($archive_query) ) + { + $info = array(); + + $msg_ids[] = $r['msg_id']; + + $from_member = $DB->query("SELECT id, name FROM ibf_members WHERE id='".$r['from_id']."'"); + + $from_mem = $DB->fetch_row($from_member); + + $info['msg_date'] = $std->get_date( $r['msg_date'], 'LONG' ); + $info['msg_title'] = $r['title']; + $info['msg_sender'] = $from_mem['name']; + $info['msg_content'] = $this->parser->convert( array( 'TEXT' => $r['message'], + 'SMILIES' => 0, + 'CODE' => $ibforums->vars['msg_allow_code'], + 'HTML' => $ibforums->vars['msg_allow_html'] + ) + ); + + if ($type == 'xls') + { + $output .= '"'.$this->strip_quotes($info['msg_title']).'","'.$this->strip_quotes($info['msg_date']).'","'.$this->strip_quotes($info['msg_sender']).'","'.$this->strip_quotes($info['msg_content']).'"'."\r"; + } + else + { + $output .= $this->html->archive_html_entry($info); + } + + } + + if ($type == 'html') + { + $output .= $this->html->archive_html_footer(); + } + + $num_msg = count( $msg_ids ); + + if ($ibforums->input['delete'] == 'yes') + { + $msg_str = implode( ",", $msg_ids ); + + if (!empty($msg_str)) + { + $DB->query("DELETE FROM ibf_messages WHERE msg_id IN ($msg_str)"); + + $DB->query("UPDATE ibf_members SET msg_total=msg_total-$num_msg WHERE id ='".$this->member['id']."'"); + } + + } + + $this->email->get_template("pm_archive"); + + $this->email->build_message( array( + 'NAME' => $this->member['name'], + ) + ); + + $this->email->subject = $ibforums->lang['arc_email_subject']; + $this->email->to = $this->member['email']; + $this->email->add_attachment( $output, $file_name, $ctype ); + $this->email->send_mail(); + + + $ibforums->lang['arc_complete'] = preg_replace( "/<#NUM#>/", "$num_msg", $ibforums->lang['arc_complete'] ); + + $this->output .= $this->html->archive_complete(); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_archive_messages' ) ); + } + + + } + + function strip_quotes($text) { + + return preg_replace( "/\"/", '\\\"', $text ); + + } + + /**********************************************************/ + // PREFS: + // + // Create/delete/edit messenger folders + /**********************************************************/ + + function prefs() { + global $ibforums, $DB, $std, $print; + + $this->output .= $this->html->prefs_header(); + + $count = 0; + + foreach( $this->msg_stats['dir_data'] as $k => $v ) + { + $extra = ""; + if ($v['id'] == 'in' or $v['id'] == 'sent') + { + $extra = "  ( ".$v['real']." - ".$ibforums->lang['cannot_remove']." )"; + } + $this->output .= $this->html->prefs_row( array( 'ID' => $v['id'], 'REAL' => $v['real'], 'EXTRA' => $extra ) ); + $count++; + } + + $this->output .= $this->html->prefs_add_dirs(); + + for ($i = $count; $i < $count+3; $i++) + { + $this->output .= $this->html->prefs_row( array( 'ID' => 'dir_'.$i, 'REAL' => '', 'EXTRA' => '' ) ); + } + + $this->output .= $this->html->prefs_footer(); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + } + + function do_prefs() { + global $ibforums, $DB, $std, $print; + + // Check to ensure than we've not tried to remove the inbox and sent items directories. + + if ( ($ibforums->input['sent'] == "") or ($ibforums->input['in'] == "") ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cannot_remove_dir' ) ); + } + + + $v_dir = 'in:'.$ibforums->input['in'].'|sent:'.$ibforums->input['sent']; + + // Fetch the rest of the dirs + + + $ids = array(); + + foreach ($ibforums->input as $key => $value) + { + if ( preg_match( "/^dir_(\d+)$/", $key, $match ) ) + { + if ($ibforums->input[$match[0]]) + { + $v_dir .= '|'.$match[0].':'.trim($ibforums->input[$match[0]]); + } + } + } + + $DB->query("UPDATE ibf_members SET vdirs='$v_dir' WHERE id='".$this->member['id']."'"); + + $std->boink_it($ibforums->base_url."&act=Msg&CODE=07"); + exit; + + } + + /**********************************************************/ + // DELETE_MEMBER: + // + // Removes a member from address book. + /**********************************************************/ + + function del_member() { + global $ibforums, $DB, $std, $print; + + if (!$ibforums->input['MID']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + $DB->query("DELETE FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); + + $std->boink_it($this->base_url."&act=Msg&CODE=02"); + exit; + } + + /**********************************************************/ + // EDIT_MEMBER: + // + // Edit a member from address book. + /**********************************************************/ + + function edit_member() { + global $ibforums, $DB, $std, $print; + + if (!$ibforums->input['MID']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + + $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); + $memb = $DB->fetch_row(); + + if (!$memb['contact_id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + $html = ""; + + $this->output .= $this->html->address_edit( array( 'SELECT' => $html, 'MEMBER' => $memb ) ); + + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."", + "".$ibforums->lang['t_book']."" ); + + } + + /**********************************************************/ + // DO_EDIT_MEMBER: + // + // Edit a member from address book. + /**********************************************************/ + + function do_edit() { + global $ibforums, $DB, $std, $print; + + if (!$ibforums->input['MID']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + if (! preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + $ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == 'yes' ? 1 : 0; + + $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$ibforums->input['MID']."'"); + $memb = $DB->fetch_row(); + + if (!$memb['contact_id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + $DB->query("UPDATE ibf_contacts SET contact_desc='".$ibforums->input['mem_desc']."', allow_msg='".$ibforums->input['allow_msg']."' WHERE id='".$memb['id']."'"); + + $std->boink_it($this->base_url."&act=Msg&CODE=02"); + exit; + + } + + + + /**********************************************************/ + // CONTACT: + // + // Shows the address book. + /**********************************************************/ + + function contact() { + global $ibforums, $DB, $std, $print; + + $this->output .= $this->html->Address_header(); + + $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' ORDER BY contact_name ASC"); + + if ( $DB->get_num_rows() ) + { + + $this->output .= $this->html->Address_table_header(); + while ( $row = $DB->fetch_row() ) + { + $row['text'] = $row['allow_msg'] + ? $ibforums->lang['can_contact'] + : $ibforums->lang['cannot_contact']; + + $this->output .= $this->html->render_address_row($row); + } + $this->output .= $this->html->end_address_table(); + + } + else + { + $this->output .= $this->html->Address_none(); + + } + + // Do we have a name to enter? + + $name_to_enter = ""; + + if ($ibforums->input['MID']) + { + if ( preg_match( "/^(\d+)$/", $ibforums->input['MID'] ) ) + { + $DB->query("SELECT name, id FROM ibf_members WHERE id='".$ibforums->input['MID']."'"); + $memb = $DB->fetch_row(); + + if ($memb['id']) + { + $name_to_enter = $memb['name']; + } + } + } + + $this->output .= $this->html->address_add($name_to_enter); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + } + + + /**********************************************************/ + // ADD MEMBER: + // + // Adds a member to the addy book. + /**********************************************************/ + + function add_member() { + global $ibforums, $DB, $std, $print; + + if (! $ibforums->input['mem_name']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + $DB->query("SELECT name, id FROM ibf_members WHERE LOWER(name)='".$ibforums->input['mem_name']."'"); + $memb = $DB->fetch_row(); + + if (! $memb['id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_user' ) ); + } + + //-------------------------------------- + // Do we already have this member in our + // address book? + //-------------------------------------- + + $DB->query("SELECT contact_id FROM ibf_contacts WHERE member_id='".$this->member['id']."' AND contact_id='".$memb['id']."'"); + + if ( $DB->get_num_rows() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'member_in_add_book' ) ); + } + + //-------------------------------------- + // Insert it into the DB + //-------------------------------------- + + $ibforums->input['allow_msg'] = $ibforums->input['allow_msg'] == 'yes' ? 1 : 0; + + $db_string = $std->compile_db_string( array( + 'member_id' => $this->member['id'], + 'contact_name' => $memb['name'], + 'allow_msg' => $ibforums->input['allow_msg'], + 'contact_desc' => $ibforums->input['mem_desc'], + 'contact_id' => $memb['id'] + ) ); + + $DB->query("INSERT INTO ibf_contacts (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + unset($db_string); + + // BUH BYE! + + $std->boink_it($this->base_url."&act=Msg&CODE=02"); + exit; + } + + + + /********************************************************************************************************************/ + // Mutli Act: + // + // Removes or moves messages. + /**********************************************************/ + + function multi_act() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // Get the ID's to delete + //-------------------------------------- + + $ids = array(); + + foreach ($ibforums->input as $key => $value) + { + if ( preg_match( "/^msgid_(\d+)$/", $key, $match ) ) + { + if ($ibforums->input[$match[0]]) + { + $ids[] = $match[1]; + } + } + } + + $affected_ids = count($ids); + + if ( $affected_ids > 0 ) + { + $id_string = implode( ",", $ids ); + + if ($ibforums->input['delete']) + { + $DB->query("DELETE FROM ibf_messages WHERE member_id='".$this->member['id']."' AND msg_id IN ($id_string)"); + + if ($ibforums->input['saved']) + { + // Did we delete from the saved folder? If so, don't update the msg stats and + // redirect back to the saved folder. + + $std->boink_it($this->base_url."&act=Msg&CODE=20"); + exit; + } + else + { + $DB->query("UPDATE ibf_members SET msg_total=msg_total-$affected_ids WHERE id='".$this->member['id']."'"); + $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); + exit; + } + + } + else if ($ibforums->input['move']) + { + $DB->query("UPDATE ibf_messages SET vid='".$this->vid."' WHERE member_id='".$this->member['id']."' AND msg_id IN ($id_string)"); + $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); + exit; + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); + } + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); + } + + } + + /**********************************************************/ + // END TRACKING + // + // Removes read tracked messages + /**********************************************************/ + + function end_tracking() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // Get the ID's to delete + //-------------------------------------- + + $ids = array(); + + foreach ($ibforums->input as $key => $value) + { + if ( preg_match( "/^msgid_(\d+)$/", $key, $match ) ) + { + if ($ibforums->input[$match[0]]) + { + $ids[] = $match[1]; + } + } + } + + $affected_ids = count($ids); + + if ( $affected_ids > 0 ) + { + $id_string = implode( ",", $ids ); + + $DB->query("UPDATE ibf_messages SET tracking=0 WHERE tracking=1 AND read_state=1 AND from_id='".$this->member['id']."' AND msg_id IN ($id_string)"); + + $std->boink_it($this->base_url."&act=Msg&CODE=30"); + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); + } + + } + + + function del_tracked() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // Get the ID's to delete + //-------------------------------------- + + $ids = array(); + + foreach ($ibforums->input as $key => $value) + { + if ( preg_match( "/^msgid_(\d+)$/", $key, $match ) ) + { + if ($ibforums->input[$match[0]]) + { + $ids[] = $match[1]; + } + } + } + + $affected_ids = count($ids); + + if ( $affected_ids > 0 ) + { + $id_string = implode( ",", $ids ); + + $DB->query("DELETE FROM ibf_messages WHERE tracking=1 AND read_state=0 AND from_id='".$this->member['id']."' AND msg_id IN ($id_string)"); + + $std->boink_it($this->base_url."&act=Msg&CODE=30"); + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); + } + + } + + /**********************************************************/ + // DELETE MESSAGE: + // + // Removes a message. + // Yes. there is no small print. + /**********************************************************/ + + function delete() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // check for a msg ID + //-------------------------------------- + + if (!$ibforums->input['MSID']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_chosen' ) ); + } + + if (! preg_match( "/^\d+$/" , $ibforums->input['MSID'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) ); + } + + //-------------------------------------- + // Delete it from the DB + //-------------------------------------- + + $DB->query("DELETE FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' AND member_id='".$this->member['id']."'"); + + $DB->query("UPDATE ibf_members SET msg_total=msg_total-1 WHERE id='".$this->member['id']."'"); + + // BYE! + + $std->boink_it($this->base_url."&act=Msg&CODE=01&VID={$this->vid}"); + exit; + } + + + /**********************************************************/ + // VIEW MESSAGE: + // + // Views a message, thats it. No, it doesn't do anything else + // I don't know why. It just does. Accept it and move on dude. + /**********************************************************/ + + function view_msg() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // check for a msg ID + //-------------------------------------- + + if (!$ibforums->input['MSID']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_msg' ) ); + } + + if (! preg_match( "/^\d+$/" , $ibforums->input['MSID'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) ); + } + + //-------------------------------------- + // Get the message from the DB + // Check to make sure it exists + //-------------------------------------- + + $DB->query("SELECT * FROM ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."'"); + $msg = $DB->fetch_row(); + + if (!$msg['msg_id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_msg' ) ); + } + + //-------------------------------------- + // Did we read this in the pop up? + // If so, reduce new count by 1 (this msg) + // 'cos if we went via inbox, we'd have + // no new msg + //-------------------------------------- + + if ($ibforums->member['new_msg'] > 0) + { + $DB->query("UPDATE ibf_members SET new_msg=new_msg-1 WHERE id='".$this->member['id']."'"); + } + + //-------------------------------------- + // Is this an unread message? + //-------------------------------------- + + if ($msg['read_state'] < 1) + { + $DB->query("UPDATE ibf_messages SET read_state='1', read_date='".time()."' WHERE msg_id='".$ibforums->input['MSID']."'"); + } + + + //-------------------------------------- + // Start formatting the member and msg + //-------------------------------------- + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + + $msg['msg_date'] = $std->get_date( $msg['msg_date'], 'LONG' ); + + + $DB->query("SELECT g.g_title as member_group, m.id, m.joined, m.name, m.title, m.posts, m.mgroup, m.email, m.signature, m.avatar, m.avatar_size, m.hide_email, m.aim_name, m.icq_number ". + "FROM ibf_members m, ibf_groups g WHERE id='".$msg['from_id']."' and g.g_id=m.mgroup"); + + $member = $DB->fetch_row(); + + $member = $this->parse_member( $member, $msg ); + + $msg['message'] = $this->parser->convert( array( TEXT => $msg['message'], + SMILIES => 1, + CODE => $ibforums->vars['msg_allow_code'], + HTML => $ibforums->vars['msg_allow_html'] + ) + ); + + if (!$ibforums->vars[SIG_SEP]) $ibforums->vars[SIG_SEP] = "

    --------------------
    "; + + if ($this->member['view_sigs']) + { + $member['signature'] = $ibforums->vars[SIG_SEP] . $this->parser->convert( array( TEXT => $member['signature'], + SMILIES => 0, + CODE => $ibforums->vars['sig_allow_ibc'], + HTML => $ibforums->vars['sig_allow_html'], + SIGNATURE => 1, + ) + ); + } + else + { + $member['signature'] = ""; + } + + $member['VID'] = $this->msg_stats['current_id']; + + $this->output .= $this->html->Render_msg( array( + 'msg' => $msg, + 'member' => $member, + 'jump' => $this->jump_html + ) ); + + + $this->page_title = $ibforums->lang['t_welcome']; + + $this->nav = array( "".$ibforums->lang['t_title']."", + "".$this->msg_stats['current_dir']."" + ); + + } + + /**********************************************************/ + // SEND MESSAGE: + // + // Sends a message. Yes, it's that simple. Why so much code? + // Because typing "send a message to member X" doesnt actually + // do anything. + /**********************************************************/ + + function send() { + global $ibforums; + + $ibforums->input['MODE'] ? $this->send_msg() : $this->send_form(); + + } + + //+----------------------------------------------------------- + + function send_form($preview=0, $errors="") { + global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; + + //-------------------------------------- + // Get some more HTML and words, oh yes. + //-------------------------------------- + + $errors = preg_replace( "/^
    /", "", $errors ); + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); + + $this->post_html = $std->load_template('skin_post'); + + if ($preview == 1) + { + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + $old_msg = $this->parser->convert( array( TEXT => $ibforums->input['Post'], + SMILIES => 1, + CODE => $ibforums->vars['msg_allow_code'], + HTML => $ibforums->vars['msg_allow_html'] + ) + ); + + $this->output .= $this->html->preview($old_msg); + + } + + if ($errors != "") + { + $this->output .= $this->html->pm_errors($errors); + $preview = 1; + } + + //-------------------------------------- + // Load the contacts + //-------------------------------------- + + $contacts = $this->build_contact_list(); + + + $name_to_enter = ""; + $old_message = ""; + $old_title = ""; + + //-------------------------------------- + // Did we come from a button with a user ID? + //-------------------------------------- + + + if (!empty($ibforums->input['MID'])) + { + $DB->query("SELECT name, id FROM ibf_members WHERE id='".$ibforums->input['MID']."'"); + $name = $DB->fetch_row(); + + if ($ibforums->input['fwd'] != 1) + { + if ($name['id']) + { + $name_to_enter = $name['name']; + } + } + } + + //-------------------------------------- + // Are we quoting an old message? + //-------------------------------------- + + if ($preview == 1) + { + $old_message = stripslashes($HTTP_POST_VARS['Post']); + $old_title = preg_replace( "/'/", "'", stripslashes($HTTP_POST_VARS['msg_title']) ); + + } + else if (!empty($ibforums->input['MSID'])) + { + $DB->query("SELECT message, title from ibf_messages WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."'"); + $old_msg = $DB->fetch_row(); + if ($old_msg['title']) + { + if ($ibforums->input['fwd'] == 1) + { + $old_title = "Fwd:".$old_msg['title']; + $old_title = preg_replace( "/^(?:Fwd\:){1,}/i", "Fwd:", $old_title ); + $old_message = '[QUOTE]'.sprintf($ibforums->lang['vm_forward_text'], $name['name'])."\n\n".$old_msg['message'].'[/QUOTE]'."\n"; + $old_message = str_replace( "
    ", "\n", $old_message ); + } + else + { + $old_title = "Re:".$old_msg['title']; + $old_title = preg_replace( "/^(?:Re\:){1,}/i", "Re:", $old_title ); + $old_message = '[QUOTE]'.$old_msg['message'].'[/QUOTE]'."\n"; + $old_message = str_replace( "
    ", "\n", $old_message ); + } + } + } + + + //-------------------------------------- + // Build up the HTML for the send form + //-------------------------------------- + + $this->output .= $this->html->Send_form( array ( + 'CONTACTS' => $contacts, + 'MEMBER' => $this->member, + 'N_ENTER' => $name_to_enter, + 'O_TITLE' => $old_title, + 'OID' => $ibforums->input['OID'], // Old unsent msg id for restoring saved msg - used to delete saved when sent + ) ); + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; + + $this->output .= $this->post_html->pm_postbox_buttons($old_message); + + $this->output .= $this->html->send_form_footer(); + + //-------------------------------------- + // Add in the smilies box + //-------------------------------------- + + $this->html_add_smilie_box(); + + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + + //---------------------------------------- + // Do we have permission to mass PM peeps? + //---------------------------------------- + + if ($ibforums->member['g_max_mass_pm'] > 0) + { + $ibforums->lang['carbon_copy_desc'] = sprintf( $ibforums->lang['carbon_copy_desc'], $ibforums->member['g_max_mass_pm'] ); + + if (isset($HTTP_POST_VARS['carbon_copy'])) + { + $cc_box = preg_replace( "##i", "", stripslashes($HTTP_POST_VARS['carbon_copy']) ); + } + + $this->output = str_replace( "", $this->html->mass_pm_box($cc_box), $this->output ); + } + + } + + + //+----------------------------------------------------------- + + function edit_saved() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------- + // Get some more HTML and words, oh yes. + //-------------------------------------- + + $errors = preg_replace( "/^
    /", "", $errors ); + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); + + $this->post_html = $std->load_template('skin_post'); + + //-------------------------------------- + // Load the contacts + //-------------------------------------- + + $contacts = $this->build_contact_list(); + + $DB->query("SELECT mg.*, m.name as to_name, m.id as to_id from ibf_messages mg, ibf_members m WHERE msg_id='".$ibforums->input['MSID']."' and member_id='".$this->member['id']."' AND m.id=mg.recipient_id"); + $msg = $DB->fetch_row(); + + if (!$msg['msg_id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_msg' ) ); + } + + //-------------------------------------- + // Build up the HTML for the send form + //-------------------------------------- + + $this->output .= $this->html->Send_form( array ( + 'CONTACTS' => $contacts, + 'MEMBER' => $this->member, + 'N_ENTER' => $msg['to_name'], + 'O_TITLE' => $msg['title'], + 'OID' => $msg['msg_id'], + ) ); + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; + + $this->output .= $this->post_html->postbox_buttons($msg['message']); + + $this->output .= $this->html->send_form_footer(); + + //-------------------------------------- + // Add in the smilies box + //-------------------------------------- + + $this->html_add_smilie_box(); + + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + + //---------------------------------------- + // Do we have permission to mass PM peeps? + //---------------------------------------- + + if ($ibforums->member['g_max_mass_pm'] > 0) + { + $ibforums->lang['carbon_copy_desc'] = sprintf( $ibforums->lang['carbon_copy_desc'], $ibforums->member['g_max_mass_pm'] ); + + if (isset($msg['cc_users'])) + { + $cc_box = preg_replace( "##i", "", $msg['cc_users'] ); + $cc_box = str_replace( "
    ", "\n", $cc_box ); + } + + $this->output = str_replace( "", $this->html->mass_pm_box($cc_box), $this->output ); + } + + } + + + //+----------------------------------------------------------- + + + function send_msg() { + global $ibforums, $DB, $std, $print; + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_error' , $ibforums->lang_id); + + $ibforums->input['from_contact'] = $ibforums->input['from_contact'] ? $ibforums->input['from_contact'] : '-'; + + //---------------------------------------------------------------- + if ( strlen($ibforums->input['msg_title']) < 2 ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg_title' ) ); + } + //---------------------------------------------------------------- + if ( strlen($ibforums->input['Post']) < 2 ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_msg' ) ); + } + //---------------------------------------------------------------- + if ($ibforums->input['from_contact'] == '-' and $ibforums->input['entered_name'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_chosen_member' ) ); + } + //---------------------------------------------------------------- + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + //-------------------------------------- + // Attempt to get the reciepient details + //-------------------------------------- + + $to_member = array(); + + if ($ibforums->input['from_contact'] == '-') + { + $query = "LOWER(name)='".$ibforums->input['entered_name']."'"; + } + else + { + $query = "id='".$ibforums->input['from_contact']."'"; + } + + $DB->query("SELECT name, id, view_pop, mgroup, email_pm, language, email FROM ibf_members WHERE ".$query); + $to_member = $DB->fetch_row(); + + if (empty($to_member['id'])) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_to_member' ) ); + } + + //-------------------------------------- + // Are we simply saving this for later? + //-------------------------------------- + + if ($ibforums->input['save'] != "") + { + + $raw = array( + 'member_id' => $this->member['id'], + 'msg_date' => time(), + 'read_state' => 0, + 'title' => $ibforums->input['msg_title'], + 'message' => $ibforums->input['Post'], + 'from_id' => $this->member['id'], + 'vid' => 'unsent', + 'recipient_id' => $to_member['id'], + 'cc_users' => $ibforums->input['carbon_copy'] + ); + + $saved = 0; + + if ($ibforums->input['OID']) + { + // We have an OID which means that this message + // is already from the unsent folder, lets check that + // and if true, update rather than create a new unsent + // row + + $DB->query("SELECT msg_id from ibf_messages WHERE msg_id='".$ibforums->input['OID']."' AND member_id='".$ibforums->member['id']."' AND vid='unsent'"); + + if ( $DB->get_num_rows() ) + { + $saved = 1; + + $db_string = $DB->compile_db_update_string($raw); + + $DB->query("UPDATE ibf_messages SET $db_string WHERE msg_id='".$ibforums->input['OID']."'"); + } + } + + if ($saved == 0) + { + $db_string = $DB->compile_db_insert_string($raw); + + $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + } + + $print->redirect_screen( $ibforums->lang['pms_redirect'] , "&act=Msg&CODE=01" ); + } + + //-------------------------------------- + // Can the reciepient use the PM system? + //-------------------------------------- + + $DB->query("SELECT m.msg_total, g.g_use_pm, g.g_max_messages FROM ibf_groups g, ibf_members m WHERE m.id='".$to_member['id']."' AND g.g_id=m.mgroup"); + $to_msg_stats = $DB->fetch_row(); + + if ($to_msg_stats['g_use_pm'] != 1) + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $ibforums->lang['no_usepm_member']); + return; + } + + //-------------------------------------- + // Does the target member have enough room + // in their inbox for a new message? + //-------------------------------------- + + if ( (($to_msg_stats['msg_total']) >= $to_msg_stats['g_max_messages']) and ($to_msg_stats['g_max_messages'] != "") ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'max_message_to' ) ); + } + + //-------------------------------------- + // Has the reciepient blocked us? + //-------------------------------------- + + $DB->query("SELECT contact_id, allow_msg FROM ibf_contacts WHERE contact_id='".$this->member['id']."' AND member_id='".$to_member['id']."'"); + $can_msg = $DB->fetch_row(); + + if ( (isset($can_msg['contact_id'])) and ($can_msg['allow_msg'] != 1) ) + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $ibforums->lang['msg_blocked']); + return; + } + + //-------------------------------------- + // Do we have enough room to store a + // saved copy? + //-------------------------------------- + + if ($ibforums->input['add_sent'] and $ibforums->member['g_max_messages']) + { + if ( ($this->msg_stats['msg_total'] + 1) >= $ibforums->member['g_max_messages'] ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'max_message_from' ) ); + } + } + + //---------------------------------------------------------------- + // Mass PM stuff + //---------------------------------------------------------------- + + $can_mass_pm = 0; + $cc_array = array(); + + if ($ibforums->member['g_max_mass_pm'] > 0) + { + $can_mass_pm = 1; + + if (isset($ibforums->input['carbon_copy']) and $ibforums->input['carbon_copy'] != "") + { + // Sort out the array + + $ibforums->input['carbon_copy'] = str_replace( "

    ", "
    ", trim($ibforums->input['carbon_copy']) ); + $ibforums->input['carbon_copy'] = preg_replace( "/^(
    ){1}/", "" , $ibforums->input['carbon_copy'] ); + $ibforums->input['carbon_copy'] = preg_replace( "/(
    ){1}$/", "" , $ibforums->input['carbon_copy'] ); + $ibforums->input['carbon_copy'] = preg_replace( "/
    \s+/", ",", $ibforums->input['carbon_copy'] ); + + $temp_array = explode( "
    ", $ibforums->input['carbon_copy'] ); + + if ( is_array($temp_array) and count($temp_array) > 0 ) + { + $new_array = array(); + + foreach( $temp_array as $name ) + { + $name = "'".trim(strtolower($name))."'"; + + if (in_array( $name, $new_array ) ) + { + continue; + } + + $new_array[] = $name; + } + } + + if ( is_array($new_array) and count($new_array) > 0 ) + { + $array_count = count($new_array); + + $DB->query("SELECT m.id, m.name, m.msg_total, m.view_pop, m.email_pm, m.language, m.email, g.g_max_messages, g.g_use_pm FROM ibf_members m, ibf_groups g ". + "WHERE LOWER(m.name) IN (".implode(",",$new_array).") ". + "AND m.mgroup=g.g_id"); + + if ( ! $DB->get_num_rows() ) + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $ibforums->lang['pme_no_cc_user']); + return; + } + else + { + while( $r = $DB->fetch_row() ) + { + $cc_array[$r['id']] = $r; + } + + //-------------------------------------- + + if ( count($cc_array) > $ibforums->member['g_max_mass_pm']) + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $ibforums->lang['pme_too_many']); + return; + } + + //-------------------------------------- + + $cc_error = ""; + + if ( count($cc_array) != $array_count ) + { + foreach( $new_array as $n ) + { + $seen = 0; + + foreach( $cc_array as $idx => $cc_user ) + { + $tmp = "'".strtolower($cc_user['name'])."'"; + + if ($tmp == $n) + { + $seen = 1; + } + } + + if ($seen != 1) + { + $cc_error .= "
    ".sprintf( $ibforums->lang['pme_failed_nomem'], $n, $n ); + } + } + } + + if ($cc_error != "") + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $cc_error); + return; + } + + //-------------------------------------- + + $cc_error = ""; + $cc_id_array = array(); + + foreach($cc_array as $idx => $cc_user) + { + if ($cc_user['g_use_pm'] != 1) + { + $cc_error .= "
    ".sprintf( $ibforums->lang['pme_failed_nopm'], $cc_user['name'], $cc_user['name'] ); + } + + if ($cc_user['g_max_messages'] > 0 and ($cc_user['msg_total'] + 1 > $cc_user['g_max_messages']) ) + { + $cc_error .= "
    ".sprintf( $ibforums->lang['pme_failed_maxed'], $cc_user['name'], $cc_user['name'] ); + } + + $cc_id_array[] = $cc_user['id']; + } + + if ($cc_error != "") + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $cc_error); + return; + } + + //-------------------------------------- + // Almost there! now just to check the block list.. + //-------------------------------------- + + $DB->query("SELECT m.name, c.allow_msg FROM ibf_members m, ibf_contacts c WHERE contact_id='".$ibforums->member['id']."' AND member_id IN (".implode(",",$cc_id_array).") AND m.id=c.member_id"); + + while ( $c = $DB->fetch_row() ) + { + if ($c['allow_msg'] != 1) + { + $cc_error .= "
    ".sprintf( $ibforums->lang['pme_failed_block'], $c['name'], $c['name'] ); + } + } + + if ($cc_error != "") + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(0, $cc_error); + return; + } + + //-------------------------------------- + + } + } + + } + } + + //-------------------------------------- + // Is this a preview? + //-------------------------------------- + + if ($ibforums->input['preview'] != "") + { + $ibforums->input['MID'] = $to_member['id']; + $this->send_form(1); + return; + } + + //----------------------------------------- + // Add our original ID to the pool and loop + //----------------------------------------- + + $cc_array[$to_member['id']] = $to_member; + + unset($to_member); + + $ibforums->input['add_tracking'] = ($ibforums->input['add_tracking'] == 1) ? 1 : 0; + + foreach ($cc_array as $user_id => $to_member) + { + + //-------------------------------------- + // Sort out tracking and pop us status + //-------------------------------------- + + $show_popup = $to_member['view_pop']; + + //-------------------------------------- + // Enter the info into the DB + // Target user side. + //-------------------------------------- + + $db_string = $std->compile_db_string( array( + 'member_id' => $to_member['id'], + 'msg_date' => time(), + 'read_state' => '0', + 'title' => $ibforums->input['msg_title'], + 'message' => $ibforums->input['Post'], + 'from_id' => $this->member['id'], + 'vid' => 'in', + 'recipient_id' => $to_member['id'], + 'tracking' => $ibforums->input['add_tracking'], + ) ); + + $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + $new_id = $DB->get_insert_id(); + unset($db_string); + + //----------------------------------------------------- + + $DB->query("UPDATE ibf_members SET ". + "msg_total = msg_total + 1, " . + "new_msg = new_msg + 1, " . + "msg_from_id='" .$this->member['id'] . "', ". + "msg_msg_id='" . $new_id . "', ". + "show_popup='" . $show_popup . "' ". + "WHERE id='" . $to_member['id'] . "'"); + + //----------------------------------------------------- + // Has this member requested a PM email nofity? + //----------------------------------------------------- + + if ($to_member['email_pm'] == 1) + { + $to_member['language'] = $to_member['language'] == "" ? 'en' : $to_member['language']; + + $this->email->get_template("pm_notify", $to_member['language']); + + $this->email->build_message( array( + 'NAME' => $to_member['name'], + 'POSTER' => $ibforums->member['name'], + 'TITLE' => $ibforums->input['msg_title'], + 'LINK' => "?act=Msg&CODE=03&VID=in&MSID=$new_id", + ) + ); + + $this->email->subject = $ibforums->lang['pm_email_subject']; + $this->email->to = $to_member['email']; + $this->email->send_mail(); + + } + } + + + //----------------------------------------------------- + // Add the data to the current members DB if we are + // adding it to our "sent items" folder + //----------------------------------------------------- + + if ($ibforums->input['add_sent']) + { + + $DB->query("UPDATE ibf_members SET ". + "msg_total = msg_total + 1 ". + "WHERE id='" . $this->member['id'] . "'"); + + $db_string = $std->compile_db_string( array( + 'member_id' => $this->member['id'], + 'msg_date' => time(), + 'read_state' => 0, + 'title' => $ibforums->lang['saved_sent_msg'].' '.$ibforums->input['msg_title'], + 'message' => $ibforums->input['Post'], + 'from_id' => $this->member['id'], + 'vid' => 'sent', + 'recipient_id' => $to_member['id'], + ) ); + + + $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + unset($db_string); + } + + if ($ibforums->input['OID']) + { + // We have an OID which means that this message + // is already from the unsent folder, if true, + // delete from unsent items. + + $DB->query("DELETE from ibf_messages WHERE msg_id='".$ibforums->input['OID']."' AND member_id='".$ibforums->member['id']."' AND vid='unsent'"); + } + + $text = preg_replace( "/<#FROM_MEMBER#>/" , $this->member['name'] , $ibforums->lang['sent_text'] ); + $text = preg_replace( "/<#TO_MEMBER#>/" , $to_member['name'] , $text ); + $text = preg_replace( "/<#MESSAGE_TITLE#>/" , $ibforums->input['msg_title'], $text ); + + $print->redirect_screen( $text , "&act=Msg&CODE=01" ); + + } + + + /**********************************************************/ + // MSG LIST: + // + // Views the inbox / folder of choice + /**********************************************************/ + + function msg_list() { + global $ibforums, $DB, $std, $print; + + $sort_key = ""; + + switch ($ibforums->input['sort']) + { + case 'rdate': + $sort_key = 'm.msg_date ASC'; + break; + case 'title': + $sort_key = 'm.title ASC'; + break; + case 'name': + $sort_key = 'mp.name ASC'; + break; + default: + $sort_key = 'm.msg_date DESC'; + break; + } + + //--------------------------------------------- + // Get the number of messages we have in total. + //--------------------------------------------- + + $DB->query("SELECT COUNT(*) as msg_total FROM ibf_messages WHERE member_id='".$this->member['id']."' AND vid <> 'unsent'"); + $total = $DB->fetch_row(); + + $total['msg_total'] = $total['msg_total'] > 0 ? $total['msg_total'] : 0; + + if ($ibforums->member['msg_total'] == "") + { + $DB->query("UPDATE ibf_members SET msg_total='".$total['msg_total']."' WHERE id='".$this->member['id']."'"); + } + + //--------------------------------------------- + // Make sure we've not exceeded our alloted allowance. + //--------------------------------------------- + + $info['full_messenger'] = ""; + $info['full_text'] = ""; + $info['total_messages'] = $total['msg_total']; + $info['img_width'] = 1; + $info['vid'] = $this->vid; + $info['date_order'] = $sort_key == 'm.msg_date DESC' ? 'rdate' : 'msg_date'; + + $amount_info = sprintf( $ibforums->lang['pmpc_info_string'], $total['msg_total'] ,$ibforums->lang['pmpc_unlimited'] ); + + if ($ibforums->member['g_max_messages'] > 0) + { + $amount_info = sprintf( $ibforums->lang['pmpc_info_string'], $total['msg_total'] ,$ibforums->member['g_max_messages'] ); + + $info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->member['g_max_messages']) * 100) ) : 0; + $info['img_width'] = $info['full_percent'] > 0 ? intval($info['full_percent']) * 3 : 1; + + if ($total['msg_total'] >=$ibforums->member['g_max_messages']) + { + $info['full_messenger'] = "".$ibforums->lang['folders_full'].""; + } + else + { + $info['full_messenger'] = str_replace( "<#PERCENT#>", $info['full_percent'], $ibforums->lang['pmpc_full_string'] ); + } + + + } + + + //--------------------------------------------- + // Print the header + //--------------------------------------------- + + if ($this->vid == 'sent') + { + $ibforums->lang['message_from'] = $ibforums->lang['message_to']; + + $DB->query("SELECT m.*, mp.name as from_name FROM ibf_messages m, ibf_members mp WHERE member_id='".$this->member['id']."' AND vid='".$this->vid."' and mp.id=m.recipient_id ORDER BY $sort_key"); + + } + else + { + $DB->query("SELECT m.*, mp.name as from_name FROM ibf_messages m, ibf_members mp WHERE member_id='".$this->member['id']."' AND vid='".$this->vid."' and mp.id=m.from_id ORDER BY $sort_key"); + } + + $this->output .= $this->html->inbox_table_header( $this->msg_stats['current_dir'], $info, $this->jump_html ); + + //--------------------------------------------- + // Get the messages + //--------------------------------------------- + + + if ( $DB->get_num_rows() ) + { + while( $row = $DB->fetch_row() ) + { + if ($this->vid == 'sent') + { + $row['icon'] = "<{M_READ}>"; + } + else + { + $row['icon'] = $row['read_state'] == 1 ? "<{M_READ}>" : "<{M_UNREAD}>"; + } + + $row['date'] = $std->get_date( $row['msg_date'] , 'LONG' ); + + if ($this->vid != 'sent') + { + $row['add_to_contacts'] = "[ vars['php_ext']}?s={$ibforums->session_id}&act=Msg&CODE=02&MID={$row['from_id']}'>{$ibforums->lang[add_to_book]} ]"; + } + else + { + $row['from_id'] = $row['recipient_id']; + } + + $d_array = array( 'msg' => $row, 'member' => $this->member, 'stat' => $this->msg_stats ); + + $this->output .= $this->html->inbox_row( $d_array ); + } + } + else + { + $this->output .= $this->html->No_msg_inbox(); + } + + + $this->output .= $this->html->end_inbox($this->jump_html, $amount_info); + + //--------------------------------------------- + // Update the message stats if we have to + //--------------------------------------------- + + if ($this->msg_stats['current_id'] == 'in') + { + $DB->query("UPDATE ibf_members SET ". + "new_msg='0' ". + "WHERE id='".$this->member['id']."'"); + } + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + + } + + +//+------------------------------------------------------------------------------------ + + /**********************************************************/ + // VIEW SAVED: + // + // View the saved folder stuff. + /**********************************************************/ + + function view_saved() { + global $ibforums, $DB, $std, $print; + + //--------------------------------------------- + // Print the header + //--------------------------------------------- + + $this->output .= $this->html->unsent_table_header(); + + $DB->query("SELECT m.*, mp.name as to_name FROM ibf_messages m, ibf_members mp WHERE member_id='".$this->member['id']."' AND vid='unsent' and mp.id=m.recipient_id ORDER BY msg_date DESC"); + + //--------------------------------------------- + // Get the messages + //--------------------------------------------- + + + if ( $DB->get_num_rows() ) + { + while( $row = $DB->fetch_row() ) + { + $row['icon'] = "<{M_READ}>"; + $row['date'] = $std->get_date( $row['msg_date'] , 'LONG' ); + $row['cc_users'] = $row['cc_users'] == "" ? $ibforums->lang['no'] : $ibforums->lang['yes']; + + $d_array = array( 'msg' => $row, 'member' => $this->member ); + + $this->output .= $this->html->unsent_row( $d_array ); + } + } + else + { + $this->output .= $this->html->No_msg_inbox(); + } + + + $this->output .= $this->html->unsent_end(); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + + } + + + function show_tracking() { + global $ibforums, $DB, $std, $print; + + //--------------------------------------------- + // Get all tracked and read messages + //--------------------------------------------- + + $this->output .= $this->html->trackread_table_header(); + + $DB->query("SELECT m.*, mp.name as to_name FROM ibf_messages m, ibf_members mp WHERE m.tracking=1 AND m.read_state=1 AND m.from_id='".$this->member['id']."' AND m.member_id=mp.id ORDER BY msg_date DESC"); + + if ( $DB->get_num_rows() ) + { + while( $row = $DB->fetch_row() ) + { + $row['icon'] = "<{M_READ}>"; + $row['date'] = $std->get_date( $row['read_date'] , 'LONG' ); + $this->output .= $this->html->trackread_row( $row ); + } + } + else + { + $this->output .= $this->html->No_msg_inbox(); + } + + + $this->output .= $this->html->trackread_end(); + + //--------------------------------------------- + // Get all tracked and UNread messages + //--------------------------------------------- + + $this->output .= $this->html->trackUNread_table_header(); + + $DB->query("SELECT m.*, mp.name as to_name FROM ibf_messages m, ibf_members mp WHERE m.tracking=1 AND m.read_state=0 AND m.from_id='".$this->member['id']."' AND m.member_id=mp.id ORDER BY msg_date DESC"); + + if ( $DB->get_num_rows() ) + { + while( $row = $DB->fetch_row() ) + { + $row['icon'] = "<{M_UNREAD}>"; + $row['date'] = $std->get_date( $row['msg_date'] , 'LONG' ); + $this->output .= $this->html->trackUNread_row( $row ); + } + } + else + { + $this->output .= $this->html->No_msg_inbox(); + } + + + $this->output .= $this->html->trackUNread_end(); + + $this->page_title = $ibforums->lang['t_welcome']; + $this->nav = array( "".$ibforums->lang['t_title']."" ); + + + } + + + /*********************************************************************/ + // Parse the member info + /*********************************************************************/ + + function parse_member($member=array(), $row=array()) { + global $ibforums, $std, $DB; + + $member['name'] = "{$member['name']}"; + + $member['avatar'] = $std->get_avatar( $member['avatar'], $ibforums->member['view_avs'], $member['avatar_size'] ); + + $member['MEMBER_JOINED'] = $ibforums->lang['m_joined'].' '.$std->get_date( $member['joined'], 'JOINED' ); + + $member['MEMBER_GROUP'] = $ibforums->lang['m_group'].' '.$member['member_group']; + + $member['MEMBER_POSTS'] = $ibforums->lang['m_posts'].' '.$member['posts']; + + $member['PROFILE_ICON'] = "<{P_PROFILE}> "; + + $member['MESSAGE_ICON'] = "<{P_MSG}> "; + + if (!$member['hide_email']) { + $member['EMAIL_ICON'] = "<{P_EMAIL}> "; + } + + if ( $member['website'] and $member['website'] = preg_match( "/^http:\/\/\S+$/", $member['WEBSITE'] ) ) { + $member['WEBSITE_ICON'] = "<{P_WEBSITE}> "; + } + + if ($member['icq_number']) { + $member['ICQ_ICON'] = "base_url}&act=ICQ&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_ICQ}> "; + } + + if ($member['aim_name']) { + $member['AOL_ICON'] = "base_url}&act=AOL&MID={$member['id']}','Pager','450','330','0','1','1','1')\"><{P_AOL}> "; + } + + //----------------------------------------------------- + + return $member; + + } + + + function html_add_smilie_box() + { + global $ibforums, $std, $DB; + + $show_table = 0; + $count = 0; + $smilies = "\n"; + + // Get the smilies from the DB + + $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); + + while ($elmo = $DB->fetch_row() ) { + + $show_table++; + $count++; + + $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; + + if ($count == $ibforums->vars['emo_per_row']) { + $smilies .= "\n\n"; + $count = 0; + } + } + + if ($count != $ibforums->vars['emo_per_row']) { + for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { + $smilies .= " \n"; + } + $smilies .= ""; + } + + $table = $this->post_html->smilie_table(); + + if ($show_table != 0) { + $table = preg_replace( "//", $smilies, $table ); + $this->output = preg_replace( "//", $table, $this->output ); + } + + } + + function build_contact_list() + { + global $DB, $std; + + $contacts = ""; + + $DB->query("SELECT * FROM ibf_contacts WHERE member_id='".$this->member['id']."' ORDER BY contact_name"); + + if ( $DB->get_num_rows() ) + { + $contacts = "\n"; + } + else + { + $contacts = $ibforums->lang['address_list_empty']; + } + + return $contacts; + } + +} + +?> diff --git a/upload/sources/Moderate.php b/upload/sources/Moderate.php index a4ecac9e..dc2544a5 100644 --- a/upload/sources/Moderate.php +++ b/upload/sources/Moderate.php @@ -1,1332 +1,2093 @@ - Moderation core module -| > Module written by Matt Mecham -| > Date started: 19th February 2002 -| -| > Module Version 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Moderate; - -class Moderate { - - var $output = ""; - var $base_url = ""; - var $html = ""; - - var $moderator = ""; - var $forum = array(); - var $topic = array(); - - var $upload_dir = ""; - - - /***********************************************************************************/ - // - // Our constructor, load words, load skin, print the topic listing - // - /***********************************************************************************/ - - function Moderate() { - - global $ibforums, $DB, $std, $print, $skin_universal, $HTTP_POST_VARS; - - // Make sure this is a POST request, not a naughty IMG redirect - - if ($ibforums->input['CODE'] != '04' && $ibforums->input['CODE'] != '20' && $ibforums->input['CODE'] != '22') - { - - if ($HTTP_POST_VARS['act'] == '') - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use') ); - } - - } - - require "./Skin/".$ibforums->skin_id."/skin_mod.php"; - - //------------------------------------- - // Compile the language file - //------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id); - - $this->html = new skin_mod(); - - //------------------------------------- - // Check the input - //------------------------------------- - - if ($ibforums->input['t']) - { - $ibforums->input['t'] = $std->is_number($ibforums->input['t']); - if (! $ibforums->input['t'] ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); - } - else - { - $DB->query("SELECT tid, title, description, posts, state, starter_id, pinned, forum_id from ibf_topics WHERE tid='".$ibforums->input['t']."'"); - $this->topic = $DB->fetch_row(); - - if (empty($this->topic['tid'])) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); - } - } - } - - if ($ibforums->input['p']) - { - $ibforums->input['p'] = $std->is_number($ibforums->input['p']); - if (! $ibforums->input['p'] ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); - } - } - - $ibforums->input['f'] = $std->is_number($ibforums->input['f']); - if (! $ibforums->input['f'] ) - { - $std->Error( array( 'LEVEL' => 1,'MSG' => 'missing_files') ); - } - - $ibforums->input['st'] = $ibforums->input['st'] ? $std->is_number($ibforums->input['st']) : 0; - - - //------------------------------------- - // Get the forum info based on the forum ID, get the category name, ID, and get the topic details - //------------------------------------- - - $DB->query("SELECT f.*, c.name as cat_name, c.id as cat_id from ibf_forums f, ibf_categories c WHERE f.id=".$ibforums->input['f']." and c.id=f.category"); - - $this->forum = $DB->fetch_row(); - - - //------------------------------------- - // Error out if we can not find the forum - //------------------------------------- - - if (!$this->forum['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - if ($ibforums->member['id']) - { - if ($ibforums->member['g_is_supmod'] != 1) - { - $DB->query("SELECT * FROM ibf_moderators WHERE forum_id='".$this->forum['id']."' AND member_id='".$ibforums->member['id']."'"); - $this->moderator = $DB->fetch_row(); - } - } - - $this->upload_dir = $ibforums->vars['upload_dir']; - - //------------------------------------- - // Convert the code ID's into something - // use mere mortals can understand.... - //------------------------------------- - - switch ($ibforums->input['CODE']) { - case '02': - $this->move_form(); - break; - case '03': - $this->delete_form(); - break; - case '04': - $this->delete_post(); - break; - case '05': - $this->edit_form(); - break; - case '00': - $this->close_topic(); - break; - case '01': - $this->open_topic(); - break; - case '08': - $this->delete_topic(); - break; - case '12': - $this->do_edit(); - break; - case '14': - $this->do_move(); - break; - case '15': - $this->pin_topic(); - break; - case '16': - $this->unpin_topic(); - break; - case '17': - $this->rebuild_topic(); - break; - //------------------------- - case '20': - $this->poll_edit_form(); - break; - case '21': - $this->poll_edit_do(); - break; - //------------------------- - case '22': - $this->poll_delete_form(); - break; - case '23': - $this->poll_delete_do(); - break; - //------------------------- - default: - $this->moderate_error(); - break; - } - - // If we have any HTML to print, do so... - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - } - - - /*************************************************/ - // EDIT POLL FORM: - // --------------- - // - /*************************************************/ - - - function poll_delete_form() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['delete_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); - $poll_data = $DB->fetch_row(); - - if (! $poll_data['pid']) - { - $this->moderate_error(); - } - - $this->output = $this->html_start_form( array( 1 => array( 'CODE', '23' ), - 2 => array( 't' , $this->topic['tid'] ), - 3 => array( 'f' , $this->forum['id'] ), - ) ); - - $this->output .= $this->html->table_top( $ibforums->lang['pd_top']." ".$this->forum['name']." > ".$this->topic['title'] ); - - $this->output .= $this->html->mod_exp( $ibforums->lang['pd_text'] ); - - $this->output .= $this->html->end_form( $ibforums->lang['pd_submit'] ); - - $this->page_title = $ibforums->lang['pd_top'].$this->topic['title']; - - $this->nav = array ( "{$this->forum['name']}", - "topic['tid']}'>{$this->topic['title']}" - ); - } - - function poll_delete_do() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['delete_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - // Remove the poll - - $DB->query("DELETE FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); - - // Remove from poll votes - - $DB->query("DELETE FROM ibf_voters WHERE tid='".$this->topic['tid']."'"); - - // Update topic - - $DB->query("UPDATE ibf_topics SET poll_state='', last_vote='', total_votes='' WHERE tid='".$this->topic['tid']."'"); - - // Boing! - - $print->redirect_screen( $ibforums->lang['pd_redirect'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - } - - - function poll_edit_do() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) - { - $passed = 1; - } - - else if ($this->moderator['edit_post'] == 1) - { - $passed = 1; - } - else - { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); - $poll_data = $DB->fetch_row(); - - if (! $poll_data['pid']) - { - $this->moderate_error(); - } - - $poll_answers = unserialize(stripslashes($poll_data['choices'])); - - reset($poll_answers); - $new_poll_array = array(); - - foreach ($poll_answers as $entry) - { - $id = $entry[0]; - $choice = $ibforums->input['POLL_'.$id]; - $votes = $entry[2]; - - $new_poll_array[] = array( $id, $choice, $votes); - } - - $poll_data['choices'] = addslashes(serialize($new_poll_array)); - - $DB->query("UPDATE ibf_polls SET ". - "choices='" . $poll_data['choices'] . "' ". - "WHERE tid='" . $this->topic['tid'] . "'"); - - //------------------------ - - // Update the topic table to change the poll_only value. - - $poll_state = $ibforums->input['pollonly'] == 1 ? 'closed' : 'open'; - - $DB->query("UPDATE ibf_topics SET poll_state='$poll_state' WHERE tid='".$this->topic['tid']."'"); - - $this->moderate_log("Edited a Poll"); - - $print->redirect_screen( $ibforums->lang['pe_done'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - } - - - //-------------------------------------- - - - function poll_edit_form() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['edit_post'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); - $poll_data = $DB->fetch_row(); - - if (! $poll_data['pid']) - { - $this->moderate_error(); - } - - $this->output = $this->html_start_form( array( 1 => array( 'CODE', '21' ), - 2 => array( 't' , $this->topic['tid'] ), - 3 => array( 'f' , $this->forum['id'] ), - ) ); - - $this->output .= $this->html->table_top( $ibforums->lang['pe_top']." ".$this->forum['name']." > ".$this->topic['title'] ); - - $poll_answers = unserialize(stripslashes($poll_data['choices'])); - - reset($poll_answers); - - foreach ($poll_answers as $entry) - { - $id = $entry[0]; - $choice = $entry[1]; - $votes = $entry[2]; - - $this->output .= $this->html->poll_entry($id, $choice); - - } - - $this->output .= $this->html->poll_select_form(); - - $this->output .= $this->html->end_form( $ibforums->lang['pe_submit'] ); - - $this->page_title = $ibforums->lang['pe_top'].$this->topic['title']; - - $this->nav = array ( "{$this->forum['name']}", - "topic['tid']}'>{$this->topic['title']}" - ); - } - - /*************************************************/ - // MOVE FORM: - // --------------- - // - /*************************************************/ - - function move_form() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['move_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - $this->output = $this->html_start_form( array( 1 => array( 'CODE', '14' ), - 2 => array( 'tid' , $this->topic['tid'] ), - 3 => array( 'sf' , $this->forum['id'] ), - ) ); - - $jump_html = $std->build_forum_jump('no_html'); - - $this->output .= $this->html->table_top( $ibforums->lang['top_move']." ".$this->forum['name']." > ".$this->topic['title'] ); - $this->output .= $this->html->mod_exp( $ibforums->lang['move_exp'] ); - $this->output .= $this->html->move_form( $jump_html , $this->forum['name']); - $this->output .= $this->html->end_form( $ibforums->lang['submit_move'] ); - - $this->page_title = $ibforums->lang['t_move'].": ".$this->topic['title']; - - $this->nav = array ( "{$this->forum['name']}", - "topic['tid']}'>{$this->topic['title']}" - ); - } - - /*************************************************/ - - function do_move() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['move_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - //---------------------------------- - // Check for input.. - //---------------------------------- - - if ($ibforums->input['sf'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_source' ) ); - } - - //---------------------------------- - - if ($ibforums->input['move_id'] == "" or $ibforums->input['move_id'] == -1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); - } - - //---------------------------------- - - if ($ibforums->input['move_id'] == $ibforums->input['sf']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_same_forum' ) ); - } - - //---------------------------------- - - $DB->query("SELECT id, subwrap FROM ibf_forums WHERE id IN(".$ibforums->input['sf'].",".$ibforums->input['move_id'].")"); - - if ($DB->get_num_rows() != 2) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); - } - - //----------------------------------- - // Check for an attempt to move into a subwrap forum - //----------------------------------- - - while ( $f = $DB->fetch_row() ) - { - if ($f['subwrap'] == 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); - } - } - - - $DB->query("SELECT * FROM ibf_topics WHERE tid='".$ibforums->input['tid']."'"); - - if ( ! $this->topic = $DB->fetch_row() ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); - } - - //---------------------------------- - // We know that $this->topic is set.. - //---------------------------------- - - $source = $ibforums->input['sf']; - $moveto = $ibforums->input['move_id']; - $tid = $ibforums->input['tid']; - - //---------------------------------- - // Update the topic - //---------------------------------- - - $DB->query("UPDATE ibf_topics SET forum_id='$moveto' WHERE forum_id='$source' AND tid='$tid'"); - - //---------------------------------- - // Update the posts - //---------------------------------- - - $DB->query("UPDATE ibf_posts SET forum_id='$moveto' WHERE forum_id='$source' AND topic_id='$tid'"); - - //---------------------------------- - // Update the polls - //---------------------------------- - - $DB->query("UPDATE ibf_polls SET forum_id='$moveto' WHERE forum_id='$source' AND tid='$tid'"); - - //---------------------------------- - // Are we leaving a link? - //---------------------------------- - - if ($ibforums->input['leave'] == 'y') - { - //---------------------------------- - // Insert a new "link" topic... - //---------------------------------- - - $db_string = $DB->compile_db_insert_string( array ( - 'title' => $this->topic['title'], - 'description' => $this->topic['description'], - 'state' => 'link', - 'posts' => 0, - 'views' => 0, - 'starter_id' => $this->topic['starter_id'], - 'start_date' => $this->topic['start_date'], - 'starter_name' => $this->topic['starter_name'], - 'last_post' => $this->topic['last_post'], - 'forum_id' => $source, - 'approved' => 1, - 'pinned' => 0, - 'moved_to' => $this->topic['tid'].'&'.$moveto, - 'last_poster_id' => $this->topic['last_poster_id'], - 'last_poster_name' => $this->topic['last_poster_name'] - ) ); - - $DB->query("INSERT INTO ibf_topics (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - } - - $this->moderate_log("Moved a topic"); - - // Resync the forums.. - - $this->recount($source); - - $this->recount($moveto); - - $print->redirect_screen( $ibforums->lang['p_moved'], "act=SF&f=".$this->forum['id']."&st=".$ibforums->input['st'] ); - - } - - - /*************************************************/ - - function delete_post() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) - { - $passed = 1; - } - else if ($ibforums->member['g_delete_own_posts'] == 1) - { - $passed = 1; - } - else if ($this->moderator['delete_post'] == 1) - { - $passed = 1; - } - else - { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - - // Get this post id. - - $DB->query("SELECT pid,attach_file, attach_id, post_date, new_topic from ibf_posts WHERE forum_id='".$this->forum['id']."' AND topic_id='".$this->topic['tid']."' and pid='".$ibforums->input['p']."'"); - if ( ! $post = $DB->fetch_row() ) - { - $this->moderate_error(); - } - - // Check to make sure that this isn't the first post in the topic.. - - if ($post['new_topic'] == 1) - { - $this->moderate_error('no_delete_post'); - } - - //--------------------------------------- - // Is there an attachment to this post? - //--------------------------------------- - - if ($post['attach_id'] != "") - { - if (is_file($this->upload_dir."/".$post['attach_id'])) - { - unlink ($this->upload_dir."/".$post['attach_id']); - } - } - - //--------------------------------------- - // delete the post - //--------------------------------------- - - $DB->query("DELETE from ibf_posts WHERE topic_id='".$this->topic['tid']."' and pid='".$post['pid']."'"); - - //--------------------------------------- - // Update the stats - //--------------------------------------- - - $DB->query("UPDATE ibf_stats SET TOTAL_REPLIES=TOTAL_REPLIES-1"); - - //--------------------------------------- - // Get the latest post details - //--------------------------------------- - - $DB->query("SELECT post_date, author_id, author_name from ibf_posts WHERE topic_id='".$this->topic['tid']."' and queued <> 1 ORDER BY pid DESC"); - $last_post = $DB->fetch_row(); - - $DB->query("UPDATE ibf_topics SET last_post='" .$last_post['post_date'] ."', ". - "last_poster_id='" .$last_post['author_id'] ."', ". - "last_poster_name='" .$last_post['author_name'] ."', ". - "posts=posts-1 WHERE tid='".$this->topic['tid']."'"); - - //--------------------------------------- - // If we deleted the last post in a topic that was - // the last post in a forum, best update that :D - //--------------------------------------- - - if ($this->forum['last_id'] == $this->topic['tid']) - { - $DB->query("SELECT title, tid, last_post, last_poster_id, last_poster_name " - ."FROM ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " - ."ORDER BY last_post DESC LIMIT 0,1"); - - $tt = $DB->fetch_row(); - - $db_string = $DB->compile_db_update_string( array( - last_title => $tt['title'] ? $tt['title'] : "", - last_id => $tt['tid'] ? $tt['tid'] : "", - last_post => $tt['last_post'] ? $tt['last_post'] : "", - last_poster_name => $tt['last_poster_name'] ? $tt['last_poster_name'] : "", - last_poster_id => $tt['last_poster_id'] ? $tt['last_poster_id'] : "", - ) ); - - $DB->query("UPDATE ibf_forums SET ".$db_string.",posts=posts-1 WHERE id='".$this->forum['id']."'"); - } - - $this->moderate_log("Deleted a post"); - - $print->redirect_screen( $ibforums->lang['post_deleted'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - - } - - function rebuild_topic() {} - - /*************************************************/ - // DELETE TOPIC: - // --------------- - // - /*************************************************/ - - function delete_form() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->topic['starter_id'] == $ibforums->member['id']) - { - if ($ibforums->member['g_delete_own_topics'] == 1) - { - $passed = 1; - } - } - - else if ($this->moderator['delete_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) { - $this->moderate_error(); - } - - $this->output = $this->html->delete_js(); - - $this->output .= $this->html_start_form( array( 1 => array( 'CODE', '08' ), - 2 => array( 't', $this->topic['tid'] ) - ) ); - - $this->output .= $this->html->table_top( $ibforums->lang['top_delete']." ".$this->forum['name']." > ".$this->topic['title'] ); - $this->output .= $this->html->mod_exp( $ibforums->lang['delete_topic'] ); - $this->output .= $this->html->end_form( $ibforums->lang['submit_delete'] ); - - $this->page_title = $ibforums->lang['t_delete'].": ".$this->topic['title']; - - $this->nav = array ( "{$this->forum['name']}", - "topic['tid']}'>{$this->topic['title']}" - ); - } - - function delete_topic() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->topic['starter_id'] == $ibforums->member['id']) - { - if ($ibforums->member['g_delete_own_topics'] == 1) - { - $passed = 1; - } - } - - else if ($this->moderator['delete_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) { - $this->moderate_error(); - } - - // Do we have a linked topic to remove? - - $DB->query("SELECT tid FROM ibf_topics WHERE state='link' AND moved_to='".$this->topic['tid'].'&'.$this->forum['id']."'"); - - if ( $linked_topic = $DB->fetch_row() ) - { - $DB->query("DELETE FROM ibf_topics WHERE tid='".$linked_topic['tid']."'"); - } - - - // Remove polls assigned to this topic - - $DB->query("DELETE FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); - - // Remove poll voters - - $DB->query("DELETE FROM ibf_voters WHERE tid='".$this->topic['tid']."'"); - - // Remove the topic itself - - $DB->query("DELETE FROM ibf_topics WHERE tid='".$this->topic['tid']."'"); - - // Get the attach ID's and filenames - - $DB->query("SELECT attach_id, attach_hits, attach_file FROM ibf_posts WHERE attach_id <> '' AND topic_id='".$this->topic['tid']."'"); - - // Remove the attachments - - if ( $DB->get_num_rows() ) - { - while ( $r = $DB->fetch_row() ) - { - if (is_file($this->upload_dir."/".$r['attach_id'])) - { - @unlink ($this->upload_dir."/".$r['attach_id']); - } - } - } - - // Remove the posts - - $DB->query("DELETE FROM ibf_posts WHERE topic_id='".$this->topic['tid']."'"); - - //------------------------------------------------ - // Update the forum topic/post and stat counters. - // - // We also need to make sure the last forum id and - // title is correct. - //------------------------------------------------ - - $DB->query("SELECT COUNT(tid) as tcount from ibf_topics WHERE approved=1"); - $topics = $DB->fetch_row(); - - $DB->query("SELECT COUNT(pid) as pcount from ibf_posts WHERE queued <> 1"); - $posts = $DB->fetch_row(); - - $DB->query("SELECT COUNT(tid) as tcount from ibf_topics WHERE approved=1 and forum_id='".$this->forum['id']."'"); - $f_topics = $DB->fetch_row(); - - $DB->query("SELECT COUNT(pid) as pcount from ibf_posts WHERE queued <> 1 and forum_id='".$this->forum['id']."'"); - $f_posts = $DB->fetch_row(); - - $this->forum['topics'] = $f_topics['tcount']; - $this->forum['posts'] = $f_posts['pcount'] - $f_topics['tcount']; - - $DB->query("SELECT title, tid, last_post, last_poster_id, last_poster_name " - ."FROM ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " - ."ORDER BY last_post DESC LIMIT 0,1"); - - $tt = $DB->fetch_row(); - - $db_string = $DB->compile_db_update_string( array( - last_title => $tt['title'] ? $tt['title'] : "", - last_id => $tt['tid'] ? $tt['tid'] : "", - last_post => $tt['last_post'] ? $tt['last_post'] : "", - last_poster_name => $tt['last_poster_name'] ? $tt['last_poster_name'] : "", - last_poster_id => $tt['last_poster_id'] ? $tt['last_poster_id'] : "", - topics => $this->forum['topics'], - posts => $this->forum['posts'] - ) ); - - $DB->query("UPDATE ibf_forums SET $db_string WHERE id='".$this->forum['id']."'"); - - // Update the main board stats. - - $posts = $posts['pcount'] - $topics['tcount']; - - $DB->query("UPDATE ibf_stats SET TOTAL_TOPICS='".$topics['tcount']."', TOTAL_REPLIES='".$posts."'"); - - $this->moderate_log("Deleted a topic"); - - $print->redirect_screen( $ibforums->lang['p_deleted'], "act=SF&f=".$this->forum['id'] ); - - } - - - /*************************************************/ - // EDIT TOPIC: - // --------------- - // - /*************************************************/ - - function edit_form() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['edit_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) - { - $this->moderate_error(); - } - - $this->output = $this->html_start_form( array( 1 => array( 'CODE', '12' ), - 2 => array( 't', $this->topic['tid'] ) - ) ); - - $this->output .= $this->html->table_top( $ibforums->lang['top_edit']." ".$this->forum['name']." > ".$this->topic['title'] ); - $this->output .= $this->html->mod_exp( $ibforums->lang['edit_topic'] ); - $this->output .= $this->html->topictitle_fields( $this->topic['title'], $this->topic['description'] ); - $this->output .= $this->html->end_form( $ibforums->lang['submit_edit'] ); - - $this->page_title = $ibforums->lang['t_edit'].": ".$this->topic['title']; - - $this->nav = array ( "{$this->forum['name']}", - "topic['tid']}'>{$this->topic['title']}" - ); - } - - function do_edit() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['edit_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - if (empty($this->topic['tid'])) { - $this->moderate_error(); - } - - if ($ibforums->input['TopicTitle'] == "") { - $std->Error( array( 'LEVEL' => 2, 'MSG' => 'no_topic_title' ) ); - } - - $topic_title = preg_replace( "/'/", "/\\'/", $ibforums->input['TopicTitle'] ); - $topic_desc = preg_replace( "/'/", "/\\'/", $ibforums->input['TopicDesc'] ); - - $DB->query("UPDATE ibf_topics SET title='$topic_title', description='$topic_desc' WHERE tid='".$this->topic['tid']."'"); - - if ($this->topic['tid'] == $this->forum['last_id']) - { - $DB->query("UPDATE ibf_forums SET last_title='$topic_title' WHERE id='".$this->forum['id']."'"); - } - - $this->moderate_log("Edited a topic title"); - - $print->redirect_screen( $ibforums->lang['p_edited'], "act=SF&f=".$this->forum['id'] ); - - - } - - - /*************************************************/ - // OPEN TOPIC: - // --------------- - // - /*************************************************/ - - function open_topic() { - global $std, $ibforums, $DB, $print; - - if ($this->topic['state'] == 'open') { - $this->moderate_error(); - } - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->topic['starter_id'] == $ibforums->member['id']) { - if ($ibforums->member['g_open_close_topics'] == 1) { - $passed = 1; - } - } - else - { - $passed = 0; - } - - if ($this->moderator['open_topic'] == 1) { - $passed = 1; - } - - - if ($passed != 1) $this->moderate_error(); - - $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'state', 'VALUE' => 'open' ) ); - - $this->moderate_log("Opened Topic"); - - $print->redirect_screen( $ibforums->lang['p_opened'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - } - - - - /*************************************************/ - // CLOSE TOPIC: - // --------------- - // - /*************************************************/ - - function close_topic() { - global $std, $ibforums, $DB, $print; - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->topic['starter_id'] == $ibforums->member['id']) { - if ($ibforums->member['g_open_close_topics'] == 1) { - $passed = 1; - } - } - else - { - $passed = 0; - } - - if ($this->moderator['close_topic'] == 1) { - $passed = 1; - } - - - if ($passed != 1) $this->moderate_error(); - - $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'state', 'VALUE' => 'closed' ) ); - - $this->moderate_log("Locked Topic"); - - $print->redirect_screen( $ibforums->lang['p_closed'], "act=SF&f=".$this->forum['id'] ); - - } - - - /*************************************************/ - // PIN TOPIC: - // --------------- - // - /*************************************************/ - - function pin_topic() { - global $std, $ibforums, $DB, $print; - - if ($this->topic['PIN_STATE'] == 1) { - $this->moderate_error(); - } - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['pin_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'pinned', 'VALUE' => '1' ) ); - - $this->moderate_log("Pinned Topic"); - - $print->redirect_screen( $ibforums->lang['p_pinned'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - } - - /*************************************************/ - // UNPIN TOPIC: - // --------------- - // - /*************************************************/ - - function unpin_topic() { - global $std, $ibforums, $DB, $print; - - if ($this->topic['pinned'] == 0) { - $this->moderate_error(); - } - - $passed = 0; - - if ($ibforums->member['g_is_supmod'] == 1) { - $passed = 1; - } - - else if ($this->moderator['unpin_topic'] == 1) { - $passed = 1; - } - else { - $passed = 0; - } - - if ($passed != 1) $this->moderate_error(); - - $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'pinned', 'VALUE' => '0' ) ); - - $this->moderate_log("Unpinned Topic"); - - $print->redirect_screen( $ibforums->lang['p_unpinned'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); - - } - -//+--------------------------------------------------------------------------------------------- - - - /*************************************************/ - // MODERATE ERROR: - // --------------- - // - // Function for error messages in this script - // - /*************************************************/ - - function moderate_error($msg = 'moderate_no_permission') { - global $std; - - $std->Error( array( 'LEVEL' => 2, 'MSG' => $msg ) ); - - // Make sure we exit.. - - exit(); - } - - /*************************************************/ - // MODERATE LOG: - // --------------- - // - // Function for adding the mod action to the DB - // - /*************************************************/ - - function moderate_log($title = 'unknown') { - global $std, $ibforums, $DB, $HTTP_REFERER, $QUERY_STRING; - - $db_string = $std->compile_db_string( array ( - 'forum_id' => $ibforums->input['f'], - 'topic_id' => $ibforums->input['t'], - 'post_id' => $ibforums->input['p'], - 'member_id' => $ibforums->member['id'], - 'member_name' => $ibforums->member['name'], - 'ip_address' => $ibforums->input['IP_ADDRESS'], - 'http_referer'=> $HTTP_REFERER, - 'ctime' => time(), - 'topic_title' => $this->topic['title'], - 'action' => $title, - 'query_string'=> $QUERY_STRING, - ) - ); - - $DB->query("INSERT INTO ibf_moderator_logs (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - } - - - /*************************************************/ - // Re Count topics for the forums: - // --------------- - // - // Handles simple moderation functions, saves on - // writing the same code over and over. - // ASS_U_ME's that the requesting user has been - // authenticated by this stage. - // - /*************************************************/ - - function recount($fid="") { - global $ibforums, $root_path, $DB, $std; - - if ($fid == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_source' ) ); - } - - // Get the topics.. - - $DB->query("SELECT COUNT(tid) as count FROM ibf_topics WHERE approved=1 and forum_id='".$fid."'"); - $topics = $DB->fetch_row(); - - // Get the posts.. - - $DB->query("SELECT COUNT(pid) as count FROM ibf_posts WHERE queued <> 1 and forum_id='".$fid."'"); - $posts = $DB->fetch_row(); - - // Get the forum last poster.. - - $DB->query("SELECT tid, title, last_poster_id, last_poster_name, last_post FROM ibf_topics WHERE approved=1 and forum_id='".$fid."' ORDER BY last_post DESC LIMIT 0,1"); - $last_post = $DB->fetch_row(); - - // Reset this forums stats - - $db_string = $DB->compile_db_update_string( array ( - 'last_poster_id' => $last_post['last_poster_id'], - 'last_poster_name' => $last_post['last_poster_name'], - 'last_post' => $last_post['last_post'], - 'last_title' => $last_post['title'], - 'last_id' => $last_post['tid'], - 'topics' => $topics['count'], - 'posts' => $posts['count'] - ) ); - - $DB->query("UPDATE ibf_forums SET $db_string WHERE id='".$fid."'"); - - } - - - /*************************************************/ - // ALTER TOPIC: - // --------------- - // - // Handles simple moderation functions, saves on - // writing the same code over and over. - // ASS_U_ME's that the requesting user has been - // authenticated by this stage. - // - /*************************************************/ - - function alter_topic( $data = array() ) { - global $ibforums, $DB; - - if ( $data['FIELD'] == "" ) return -1; - if ( $data['VALUE'] == "" ) return -1; - if ( $data['TOPIC'] == "" ) return -1; - - if ($data['TOPIC'] < 1) return -1; - - $data['VALUE'] = preg_replace( "/'/", "\\'", $data['VALUE'] ); - - $DB->query("UPDATE ibf_topics SET ".$data['FIELD']."='".$data['VALUE']."' WHERE tid='".$data['TOPIC']."'"); - } - - /*****************************************************/ - // HTML: start form. - // ------------------ - // Returns the HTML for the
    opening tag - /*****************************************************/ - - function html_start_form($additional_tags=array()) { - global $ibforums; - - $form = "". - "". - "". - "". - ""; - - // Any other tags to add? - - if (isset($additional_tags)) { - foreach($additional_tags as $k => $v) { - $form .= "\n"; - } - } - - return $form; - } - -} - -?> + Moderation core module +| > Module written by Matt Mecham +| > Date started: 19th February 2002 +| +| > Module Version 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Moderate; + +class Moderate { + + var $output = ""; + var $base_url = ""; + var $html = ""; + + var $moderator = ""; + var $forum = array(); + var $topic = array(); + + var $upload_dir = ""; + + + /***********************************************************************************/ + // + // Our constructor, load words, load skin, print the topic listing + // + /***********************************************************************************/ + + function Moderate() { + + global $ibforums, $DB, $std, $print, $skin_universal, $HTTP_POST_VARS; + + // Make sure this is a POST request, not a naughty IMG redirect + + if ($ibforums->input['CODE'] != '04' && $ibforums->input['CODE'] != '02' && $ibforums->input['CODE'] != '20' && $ibforums->input['CODE'] != '22') + { + + if ($HTTP_POST_VARS['act'] == '') + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use') ); + } + + } + + //------------------------------------- + // Compile the language file + //------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_mod', $ibforums->lang_id); + + $this->html = $std->load_template('skin_mod');; + + //------------------------------------- + // Check the input + //------------------------------------- + + if ($ibforums->input['t']) + { + $ibforums->input['t'] = intval($ibforums->input['t']); + if (! $ibforums->input['t'] ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); + } + else + { + $DB->query("SELECT tid, title, description, posts, state, starter_id, pinned, forum_id, last_post from ibf_topics WHERE tid='".$ibforums->input['t']."'"); + $this->topic = $DB->fetch_row(); + + if (empty($this->topic['tid'])) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); + } + } + } + + if ($ibforums->input['p']) + { + $ibforums->input['p'] = intval($ibforums->input['p']); + if (! $ibforums->input['p'] ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') ); + } + } + + $ibforums->input['f'] = intval($ibforums->input['f']); + if (! $ibforums->input['f'] ) + { + $std->Error( array( 'LEVEL' => 1,'MSG' => 'missing_files') ); + } + + $ibforums->input['st'] = $ibforums->input['st'] ? $std->is_number($ibforums->input['st']) : 0; + + + //------------------------------------- + // Get the forum info based on the forum ID, get the category name, ID, and get the topic details + //------------------------------------- + + $DB->query("SELECT f.*, c.name as cat_name, c.id as cat_id from ibf_forums f, ibf_categories c WHERE f.id=".$ibforums->input['f']." and c.id=f.category"); + + $this->forum = $DB->fetch_row(); + + + //------------------------------------- + // Error out if we can not find the forum + //------------------------------------- + + if (!$this->forum['id']) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + + if ($ibforums->member['id']) + { + if ($ibforums->member['g_is_supmod'] != 1) + { + $DB->query("SELECT * FROM ibf_moderators WHERE forum_id='".$this->forum['id']."' AND (member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))"); + $this->moderator = $DB->fetch_row(); + } + } + + $this->upload_dir = $ibforums->vars['upload_dir']; + + //------------------------------------- + // Convert the code ID's into something + // use mere mortals can understand.... + //------------------------------------- + + switch ($ibforums->input['CODE']) { + case '02': + $this->move_form(); + break; + case '03': + $this->delete_form(); + break; + case '04': + $this->delete_post(); + break; + case '05': + $this->edit_form(); + break; + case '00': + $this->close_topic(); + break; + case '01': + $this->open_topic(); + break; + case '08': + $this->delete_topic(); + break; + case '12': + $this->do_edit(); + break; + case '14': + $this->do_move(); + break; + case '15': + $this->pin_topic(); + break; + case '16': + $this->unpin_topic(); + break; + case '17': + $this->rebuild_topic(); + break; + //------------------------- + case '20': + $this->poll_edit_form(); + break; + case '21': + $this->poll_edit_do(); + break; + //------------------------- + case '22': + $this->poll_delete_form(); + break; + case '23': + $this->poll_delete_do(); + break; + //------------------------- + case '30': + $this->unsubscribe_all_form(); + break; + case '31': + $this->unsubscribe_all(); + break; + + //------------------------- + + case '50': + $this->split_start(); + break; + + case '51': + $this->split_complete(); + break; + + //------------------------- + + case '60': + $this->merge_start(); + break; + case '61': + $this->merge_complete(); + break; + + //------------------------- + + case '90': + $this->topic_history(); + break; + + default: + $this->moderate_error(); + break; + } + + // If we have any HTML to print, do so... + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + /*************************************************/ + // TOPIC HISTORY: + // --------------- + // + /*************************************************/ + + + function topic_history() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_access_cp'] == 1) { + $passed = 1; + } + else + { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $tid = intval($ibforums->input['t']); + + //----------------------------------------- + // Get all info for this topic-y-poos + //----------------------------------------- + + $DB->query("SELECT * FROM ibf_topics WHERE tid='$tid'"); + + $topic = $DB->fetch_row(); + + if ($topic['last_post'] == $topic['start_date']) + { + $avg_posts = 1; + } + else + { + $avg_posts = round( ($topic['posts'] + 1) / ((( $topic['last_post'] - $topic['start_date']) / 86400)), 1); + } + + if ($avg_posts < 0) + { + $avg_posts = 1; + } + + $data = array( + 'th_topic' => $topic['title'], + 'th_desc' => $topic['description'], + 'th_start_date' => $std->get_date($topic['start_date'], 'LONG'), + 'th_start_name' => $std->make_profile_link($topic['starter_name'], $topic['starter_id'] ), + 'th_last_date' => $std->get_date($topic['last_post'], 'LONG'), + 'th_last_name' => $std->make_profile_link($topic['last_poster_name'], $topic['last_poster_id'] ), + 'th_avg_post' => $avg_posts, + ); + + $this->output .= $this->html->topic_history($data); + + $this->output .= $this->html->mod_log_start(); + + // Do we have any logs in the mod-logs DB about this topic? eh? well? + + $DB->query("SELECT * FROM ibf_moderator_logs WHERE topic_id='$tid' ORDER BY ctime DESC"); + + if ( ! $DB->get_num_rows() ) + { + $this->output .= $this->html->mod_log_none(); + } + else + { + while ($row = $DB->fetch_row()) + { + $row['member'] = $std->make_profile_link($row['member_name'], $row['member_id'] ); + $row['date'] = $std->get_date($row['ctime'], 'LONG'); + $this->output .= $this->html->mod_log_row($row); + } + } + + $this->output .= $this->html->mod_log_end(); + + $this->page_title = $this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + //=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + + /*************************************************/ + // SPLIT TOPICS: + // --------------- + // + /*************************************************/ + + + function split_start() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['split_merge'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + //----------------------------------------- + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + //----------------------------------------- + + $jump_html = $std->build_forum_jump(0,1); + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '51' ), + 2 => array( 't' , $this->topic['tid'] ), + 3 => array( 'f' , $this->forum['id'] ), + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['st_top']." ".$this->forum['name']." > ".$this->topic['title'] ); + + $this->output .= $this->html->mod_exp( $ibforums->lang['st_explain'] ); + + $this->output .= $this->html->split_body( $jump_html ); + + //----------------------------------------- + // Display the posty wosty's + //----------------------------------------- + + $post_query = $DB->query("SELECT post, pid, post_date, author_id, author_name + FROM ibf_posts + WHERE topic_id='{$this->topic['tid']}' + AND queued <> 1 + ORDER BY post_date"); + + $post_count = 0; + + while ( $row = $DB->fetch_row($post_query) ) + { + + // Limit posts to 200 chars to stop shite loads of pages + + if ( strlen($row['post']) > 800 ) + { + $row['post'] = $this->parser->unconvert($row['post']); + $row['post'] = substr($row['post'], 0, 800) . '...'; + } + + $row['date'] = $std->get_date( $row['post_date'], 'LONG' ); + + $row['st_top_bit'] = sprintf( $ibforums->lang['st_top_bit'], $row['author_name'], $row['date'] ); + + $row['post_css'] = $post_count % 2 ? 'row1' : 'row2'; + + $this->output .= $this->html->split_row( $row ); + + $post_count++; + } + + //----------------------------------------- + // print my bottom, er, the bottom + //----------------------------------------- + + $this->output .= $this->html->split_end_form( $ibforums->lang['st_submit'] ); + + $this->page_title = $ibforums->lang['st_top']." ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + //=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + + function split_complete() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['split_merge'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + //------------------------------------------ + // Check the input + //------------------------------------------ + + if ($ibforums->input['title'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); + } + + //------------------------------------------ + // Get the post ID's to split + //------------------------------------------ + + $ids = array(); + + foreach ($ibforums->input as $key => $value) + { + if ( preg_match( "/^post_(\d+)$/", $key, $match ) ) + { + if ($ibforums->input[$match[0]]) + { + $ids[] = $match[1]; + } + } + } + + $affected_ids = count($ids); + + // Do we have enough? + + if ($affected_ids < 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'split_not_enough' ) ); + } + + // Complete the PID string + + $pid_string = implode( ",", $ids ); + + //---------------------------------------------------- + // Check the forum we're moving this too + //---------------------------------------------------- + + $ibforums->input['fid'] = intval($ibforums->input['fid']); + + if ($ibforums->input['fid'] != $this->forum['id']) + { + $DB->query("SELECT id, subwrap, sub_can_post FROM ibf_forums WHERE id='".$ibforums->input['fid']."'"); + + if ( ! $f = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); + } + + if ($f['subwrap'] == 1 and $f['sub_can_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'forum_no_post_allowed' ) ); + } + } + + //---------------------------------------------------- + // Complete a new dummy topic + //---------------------------------------------------- + + $new_topic = array( + 'title' => $ibforums->input['title'], + 'description' => $ibforums->input['desc'] , + 'state' => 'open', + 'posts' => 0, + 'starter_id' => 0, + 'starter_name' => 0, + 'start_date' => time(), + 'last_poster_id' => 0, + 'last_poster_name' => 0, + 'last_post' => time(), + 'icon_id' => 0, + 'author_mode' => 1, + 'poll_state' => 0, + 'last_vote' => 0, + 'views' => 0, + 'forum_id' => $ibforums->input['fid'], + 'approved' => 1, + 'pinned' => 0, + ); + + $db_string = $DB->compile_db_insert_string( $new_topic ); + + $DB->query("INSERT INTO ibf_topics (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + $new_topic_id = $DB->get_insert_id(); + + //---------------------------------------------------- + // Move the posts + //---------------------------------------------------- + + $DB->query("UPDATE ibf_posts SET forum_id='".$ibforums->input['fid']."', topic_id='$new_topic_id' WHERE pid IN($pid_string)"); + + //---------------------------------------------------- + // NEW TOPIC: Get the last / first post in the "new" topic + //---------------------------------------------------- + + $DB->query("SELECT author_id, author_name, post_date FROM ibf_posts WHERE topic_id='$new_topic_id' ORDER BY post_date DESC LIMIT 1"); + + $last_post = $DB->fetch_row(); + + $DB->query("SELECT pid, author_id, author_name, post_date FROM ibf_posts WHERE topic_id='$new_topic_id' ORDER BY post_date ASC LIMIT 1"); + + $first_post = $DB->fetch_row(); + + // Get the number of posts in this "new" topic + + $DB->query("SELECT count(pid) as posts FROM ibf_posts WHERE queued <> 1 AND topic_id='$new_topic_id'"); + + $post_count = $DB->fetch_row(); + + // Remove 1 from the count as we don't count the first post + + $post_count['posts']--; + + //---------------------------------------------------- + // NEW TOPIC: Update new topic entry in DB + //---------------------------------------------------- + + $new_topic = array( + 'posts' => $post_count['posts'], + 'starter_id' => $first_post['author_id'], + 'starter_name' => $first_post['author_name'], + 'start_date' => $first_post['post_date'], + 'last_poster_id' => $last_post['author_id'], + 'last_poster_name' => $last_post['author_name'], + 'last_post' => $last_post['post_date'], + 'author_mode' => $first_post['author_id'] ? 1 : 0, + ); + + $db_string = $DB->compile_db_update_string( $new_topic ); + + $DB->query("UPDATE ibf_topics SET $db_string WHERE tid='$new_topic_id'"); + + //---------------------------------------------------- + // NEW TOPIC: Reset the new_topic bit + //---------------------------------------------------- + + $DB->query("UPDATE ibf_posts SET new_topic=0 WHERE topic_id='$new_topic_id'"); + + $DB->query("UPDATE ibf_posts SET new_topic=1 WHERE topic_id='$new_topic_id' AND pid='".$first_post['pid']."'"); + + unset($last_post); + unset($first_post); + unset($post_count); + unset($new_topic); + + //---------------------------------------------------- + // OLD TOPIC: Get the last / first post in the "old" topic + //---------------------------------------------------- + + $DB->query("SELECT author_id, author_name, post_date FROM ibf_posts WHERE topic_id='".$this->topic['tid']."' ORDER BY post_date DESC LIMIT 1"); + + $last_post = $DB->fetch_row(); + + $DB->query("SELECT pid, author_id, author_name, post_date FROM ibf_posts WHERE topic_id='".$this->topic['tid']."' ORDER BY post_date ASC LIMIT 1"); + + $first_post = $DB->fetch_row(); + + // Get the number of posts in this "new" topic + + $DB->query("SELECT count(pid) as posts FROM ibf_posts WHERE queued <> 1 AND topic_id='".$this->topic['tid']."'"); + + $post_count = $DB->fetch_row(); + + // Remove 1 from the count as we don't count the first post + + $post_count['posts']--; + + //---------------------------------------------------- + // OLD TOPIC: Update new topic entry in DB + //---------------------------------------------------- + + $new_topic = array( + 'posts' => $post_count['posts'], + 'starter_id' => $first_post['author_id'], + 'starter_name' => $first_post['author_name'], + 'start_date' => $first_post['post_date'], + 'last_poster_id' => $last_post['author_id'], + 'last_poster_name' => $last_post['author_name'], + 'last_post' => $last_post['post_date'], + 'author_mode' => $first_post['author_id'] ? 1 : 0, + ); + + $db_string = $DB->compile_db_update_string( $new_topic ); + + $DB->query("UPDATE ibf_topics SET $db_string WHERE tid='".$this->topic['tid']."'"); + + //---------------------------------------------------- + // OLD TOPIC: Reset the new_topic bit + //---------------------------------------------------- + + $DB->query("UPDATE ibf_posts SET new_topic=0 WHERE topic_id='".$this->topic['tid']."'"); + + $DB->query("UPDATE ibf_posts SET new_topic=1 WHERE topic_id='".$this->topic['tid']."' AND pid='".$first_post['pid']."'"); + + //---------------------------------------------------- + // Update the forum(s) + //---------------------------------------------------- + + $this->recount($this->topic['forum_id']); + + if ($this->topic['forum_id'] != $ibforums->input['fid']) + { + $this->recount($ibforums->input['fid']); + } + + $this->moderate_log("Split topic '{$this->topic['title']}'"); + + $print->redirect_screen( $ibforums->lang['st_redirect'], "act=SF&f=".$this->forum['id'] ); + + } + + + /*************************************************/ + // MERGE TOPICS: + // --------------- + // + /*************************************************/ + + + function merge_start() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['split_merge'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '61' ), + 2 => array( 't' , $this->topic['tid'] ), + 3 => array( 'f' , $this->forum['id'] ), + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['mt_top']." ".$this->forum['name']." > ".$this->topic['title'] ); + + $this->output .= $this->html->mod_exp( $ibforums->lang['mt_explain'] ); + + $this->output .= $this->html->merge_body( $this->topic['title'], $this->topic['description'] ); + + $this->output .= $this->html->end_form( $ibforums->lang['mt_submit'] ); + + $this->page_title = $ibforums->lang['mt_top']." ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + //=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + + function merge_complete() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['split_merge'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + //------------------------------------------ + // Check the input + //------------------------------------------ + + if ($ibforums->input['topic_url'] == "" or $ibforums->input['title'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); + } + + //------------------------------------------ + // Get the topic ID of the entered URL + //------------------------------------------ + + preg_match( "/(\?|&)t=(\d+)($|&)/", $ibforums->input['topic_url'], $match ); + + $old_id = intval(trim($match[2])); + + if ($old_id == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'mt_no_topic' ) ); + } + + //------------------------------------------ + // Get the topic from the DB + //------------------------------------------ + + $DB->query("SELECT tid, title, forum_id, last_post, last_poster_id, last_poster_name, posts, views FROM ibf_topics WHERE tid='$old_id'"); + + if ( ! $old_topic = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'mt_no_topic' ) ); + } + + //---------------------------------------------------- + // Update the posts, remove old polls, subs and topic + //---------------------------------------------------- + + $DB->query("UPDATE ibf_posts SET forum_id='".$this->topic['forum_id']."', topic_id='".$this->topic['tid']."' WHERE topic_id='".$old_topic['tid']."'"); + + $DB->query("DELETE FROM ibf_polls WHERE tid='".$old_topic['tid']."'"); + + $DB->query("DELETE FROM ibf_voters WHERE tid='".$old_topic['tid']."'"); + + $DB->query("DELETE FROM ibf_tracker WHERE topic_id='".$old_topic['tid']."'"); + + $DB->query("DELETE FROM ibf_topics WHERE tid='".$old_topic['tid']."'"); + + //---------------------------------------------------- + // Update the newly merged topic + //---------------------------------------------------- + + $updater = array( 'title' => $ibforums->input['title'], + 'description' => $ibforums->input['desc'] + ); + + if ($old_topic['last_post'] > $this->topic['last_post']) + { + $updater['last_post'] = $old_topic['last_post']; + $updater['last_poster_name'] = $old_topic['last_poster_name']; + $updater['last_poster_id'] = $old_topic['last_poster_id']; + } + + // We need to now count the original post, which isn't in the "posts" field 'cos it was a new topic + + $old_topic['posts']++; + + $str = $DB->compile_db_update_string($updater); + + $DB->query("UPDATE ibf_topics SET $str,views=views+{$old_topic['views']} WHERE tid='".$this->topic['tid']."'"); + + //---------------------------------------------------- + // Fix up the "new_topic" attribute. + //---------------------------------------------------- + + $DB->query("UPDATE ibf_posts SET new_topic=0 WHERE topic_id='".$this->topic['tid']."'"); + + $DB->query("SELECT pid, author_name, author_id, post_date FROM ibf_posts WHERE topic_id='".$this->topic['tid']."' ORDER BY post_date ASC LIMIT 1"); + + if ( $first_post = $DB->fetch_row() ) + { + $DB->query("UPDATE ibf_posts SET new_topic=1 WHERE pid='".$first_post['pid']."'"); + } + + //---------------------------------------------------- + // Reset the post count for this topic + //---------------------------------------------------- + + $amode = $first_post['author_id'] ? 1 : 0; + + $DB->query("SELECT count(pid) as posts FROM ibf_posts WHERE queued <> 1 AND topic_id='".$this->topic['tid']."'"); + + if ( $post_count = $DB->fetch_row() ) + { + $post_count['posts']--; //Remove first post + + $DB->query("UPDATE ibf_topics + SET posts=".$post_count['posts'].", + starter_name='".$first_post['author_name']."', + starter_id='".$first_post['author_id']."', + start_date='".$first_post['post_date']."', + author_mode=$amode + WHERE tid='".$this->topic['tid']."'"); + } + + //---------------------------------------------------- + // Update the forum(s) + //---------------------------------------------------- + + $this->recount($this->topic['forum_id']); + + if ($this->topic['forum_id'] != $old_topic['forum_id']) + { + $this->recount($old_topic['forum_id']); + } + + $this->moderate_log("Merged topic '{$old_topic['title']}' with '{$this->topic['title']}'"); + + $print->redirect_screen( $ibforums->lang['mt_redirect'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid'] ); + + } + + + /*************************************************/ + // UNSUBSCRIBE ALL FORM: + // --------------------- + // + /*************************************************/ + + + function unsubscribe_all_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $DB->query("SELECT COUNT(trid) as subbed FROM ibf_tracker WHERE topic_id='".$this->topic['tid']."'"); + + $tracker = $DB->fetch_row(); + + /*if (! $tracker = $DB->fetch_row() ) + { + $this->moderate_error(); + }*/ + + if ( $tracker['subbed'] < 1 ) + { + $text = $ibforums->lang['ts_none']; + } + else + { + $text = sprintf($ibforums->lang['ts_count'], $tracker['subbed']); + } + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '31' ), + 2 => array( 't' , $this->topic['tid'] ), + 3 => array( 'f' , $this->forum['id'] ), + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['ts_title']." > ".$this->forum['name']." > ".$this->topic['title'] ); + + $this->output .= $this->html->mod_exp( $text ); + + $this->output .= $this->html->end_form( $ibforums->lang['ts_submit'] ); + + $this->page_title = $ibforums->lang['ts_title']." > ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + //--------------------------------- + + + function unsubscribe_all() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + // Delete the subbies based on this topic ID + + $DB->query("DELETE FROM ibf_tracker WHERE topic_id='".$this->topic['tid']."'"); + + $print->redirect_screen( $ibforums->lang['ts_redirect'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + + + /*************************************************/ + // EDIT POLL FORM: + // --------------- + // + /*************************************************/ + + + function poll_delete_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['delete_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); + $poll_data = $DB->fetch_row(); + + if (! $poll_data['pid']) + { + $this->moderate_error(); + } + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '23' ), + 2 => array( 't' , $this->topic['tid'] ), + 3 => array( 'f' , $this->forum['id'] ), + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['pd_top']." ".$this->forum['name']." > ".$this->topic['title'] ); + + $this->output .= $this->html->mod_exp( $ibforums->lang['pd_text'] ); + + $this->output .= $this->html->end_form( $ibforums->lang['pd_submit'] ); + + $this->page_title = $ibforums->lang['pd_top'].$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + function poll_delete_do() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['delete_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + // Remove the poll + + $DB->query("DELETE FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); + + // Remove from poll votes + + $DB->query("DELETE FROM ibf_voters WHERE tid='".$this->topic['tid']."'"); + + // Update topic + + $DB->query("UPDATE ibf_topics SET poll_state='', last_vote='', total_votes='' WHERE tid='".$this->topic['tid']."'"); + + // Boing! + + $print->redirect_screen( $ibforums->lang['pd_redirect'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + + + function poll_edit_do() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) + { + $passed = 1; + } + + else if ($this->moderator['edit_post'] == 1) + { + $passed = 1; + } + else + { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); + $poll_data = $DB->fetch_row(); + + if (! $poll_data['pid']) + { + $this->moderate_error(); + } + + $poll_answers = unserialize(stripslashes($poll_data['choices'])); + + reset($poll_answers); + $new_poll_array = array(); + + foreach ($poll_answers as $entry) + { + $id = $entry[0]; + $choice = $ibforums->input['POLL_'.$id]; + $votes = $entry[2]; + + $new_poll_array[] = array( $id, $choice, $votes); + } + + $poll_data['choices'] = addslashes(serialize($new_poll_array)); + + $DB->query("UPDATE ibf_polls SET ". + "choices='" . $poll_data['choices'] . "' ". + "WHERE tid='" . $this->topic['tid'] . "'"); + + //------------------------ + + // Update the topic table to change the poll_only value. + + $poll_state = $ibforums->input['pollonly'] == 1 ? 'closed' : 'open'; + + $DB->query("UPDATE ibf_topics SET poll_state='$poll_state' WHERE tid='".$this->topic['tid']."'"); + + $this->moderate_log("Edited a Poll"); + + $print->redirect_screen( $ibforums->lang['pe_done'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + + + //-------------------------------------- + + + function poll_edit_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['edit_post'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $DB->query("SELECT * FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); + $poll_data = $DB->fetch_row(); + + if (! $poll_data['pid']) + { + $this->moderate_error(); + } + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '21' ), + 2 => array( 't' , $this->topic['tid'] ), + 3 => array( 'f' , $this->forum['id'] ), + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['pe_top']." ".$this->forum['name']." > ".$this->topic['title'] ); + + $poll_answers = unserialize(stripslashes($poll_data['choices'])); + + reset($poll_answers); + + foreach ($poll_answers as $entry) + { + $id = $entry[0]; + $choice = $entry[1]; + $votes = $entry[2]; + + $this->output .= $this->html->poll_entry($id, $choice); + + } + + $this->output .= $this->html->poll_select_form(); + + $this->output .= $this->html->end_form( $ibforums->lang['pe_submit'] ); + + $this->page_title = $ibforums->lang['pe_top'].$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + /*************************************************/ + // MOVE FORM: + // --------------- + // + /*************************************************/ + + function move_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['move_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '14' ), + 2 => array( 'tid' , $this->topic['tid'] ), + 3 => array( 'sf' , $this->forum['id'] ), + ) ); + + $jump_html = $std->build_forum_jump('no_html'); + + $this->output .= $this->html->table_top( $ibforums->lang['top_move']." ".$this->forum['name']." > ".$this->topic['title'] ); + $this->output .= $this->html->mod_exp( $ibforums->lang['move_exp'] ); + $this->output .= $this->html->move_form( $jump_html , $this->forum['name']); + $this->output .= $this->html->end_form( $ibforums->lang['submit_move'] ); + + $this->page_title = $ibforums->lang['t_move'].": ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + /*************************************************/ + + function do_move() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['move_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + //---------------------------------- + // Check for input.. + //---------------------------------- + + if ($ibforums->input['sf'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_source' ) ); + } + + //---------------------------------- + + if ($ibforums->input['move_id'] == "" or $ibforums->input['move_id'] == -1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); + } + + //---------------------------------- + + if ($ibforums->input['move_id'] == $ibforums->input['sf']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_same_forum' ) ); + } + + //---------------------------------- + + $DB->query("SELECT id, subwrap, sub_can_post, name FROM ibf_forums WHERE id IN(".$ibforums->input['sf'].",".$ibforums->input['move_id'].")"); + + if ($DB->get_num_rows() != 2) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); + } + + $source_name = ""; + $dest_name = ""; + + //----------------------------------- + // Check for an attempt to move into a subwrap forum + //----------------------------------- + + while ( $f = $DB->fetch_row() ) + { + if ($f['id'] == $ibforums->input['sf']) + { + $source_name = $f['name']; + } + else + { + $dest_name = $f['name']; + } + + if ($f['subwrap'] == 1 and $f['sub_can_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'forum_no_post_allowed' ) ); + } + } + + + $DB->query("SELECT * FROM ibf_topics WHERE tid='".$ibforums->input['tid']."'"); + + if ( ! $this->topic = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_forum' ) ); + } + + //---------------------------------- + // We know that $this->topic is set.. + //---------------------------------- + + $source = $ibforums->input['sf']; + $moveto = $ibforums->input['move_id']; + $tid = $ibforums->input['tid']; + + //---------------------------------- + // Update the topic + //---------------------------------- + + $DB->query("UPDATE ibf_topics SET forum_id='$moveto' WHERE forum_id='$source' AND tid='$tid'"); + + //---------------------------------- + // Update the posts + //---------------------------------- + + $DB->query("UPDATE ibf_posts SET forum_id='$moveto' WHERE forum_id='$source' AND topic_id='$tid'"); + + //---------------------------------- + // Update the polls + //---------------------------------- + + $DB->query("UPDATE ibf_polls SET forum_id='$moveto' WHERE forum_id='$source' AND tid='$tid'"); + + //---------------------------------- + // Are we leaving a link? + //---------------------------------- + + if ($ibforums->input['leave'] == 'y') + { + //---------------------------------- + // Insert a new "link" topic... + //---------------------------------- + + $db_string = $DB->compile_db_insert_string( array ( + 'title' => $this->topic['title'], + 'description' => $this->topic['description'], + 'state' => 'link', + 'posts' => 0, + 'views' => 0, + 'starter_id' => $this->topic['starter_id'], + 'start_date' => $this->topic['start_date'], + 'starter_name' => $this->topic['starter_name'], + 'last_post' => $this->topic['last_post'], + 'forum_id' => $source, + 'approved' => 1, + 'pinned' => 0, + 'moved_to' => $this->topic['tid'].'&'.$moveto, + 'last_poster_id' => $this->topic['last_poster_id'], + 'last_poster_name' => $this->topic['last_poster_name'] + ) ); + + $DB->query("INSERT INTO ibf_topics (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + } + + $this->moderate_log("Moved a topic from $source_name to $dest_name"); + + // Resync the forums.. + + $this->recount($source); + + $this->recount($moveto); + + $print->redirect_screen( $ibforums->lang['p_moved'], "act=SF&f=".$this->forum['id']."&st=".$ibforums->input['st'] ); + + } + + + /*************************************************/ + + function delete_post() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) + { + $passed = 1; + } + else if ($this->moderator['delete_post'] == 1) + { + $passed = 1; + } + else if ($ibforums->member['g_delete_own_posts'] == 1) + { + $passed = 1; + } + else + { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + + // Get this post id. + + $DB->query("SELECT pid,attach_file, attach_id, post_date, new_topic from ibf_posts WHERE forum_id='".$this->forum['id']."' AND topic_id='".$this->topic['tid']."' and pid='".$ibforums->input['p']."'"); + if ( ! $post = $DB->fetch_row() ) + { + $this->moderate_error(); + } + + // Check to make sure that this isn't the first post in the topic.. + + if ($post['new_topic'] == 1) + { + $this->moderate_error('no_delete_post'); + } + + //--------------------------------------- + // Is there an attachment to this post? + //--------------------------------------- + + if ($post['attach_id'] != "") + { + if (is_file($this->upload_dir."/".$post['attach_id'])) + { + unlink ($this->upload_dir."/".$post['attach_id']); + } + } + + //--------------------------------------- + // delete the post + //--------------------------------------- + + $DB->query("DELETE from ibf_posts WHERE topic_id='".$this->topic['tid']."' and pid='".$post['pid']."'"); + + //--------------------------------------- + // Update the stats + //--------------------------------------- + + $DB->query("UPDATE ibf_stats SET TOTAL_REPLIES=TOTAL_REPLIES-1"); + + //--------------------------------------- + // Get the latest post details + //--------------------------------------- + + $DB->query("SELECT post_date, author_id, author_name from ibf_posts WHERE topic_id='".$this->topic['tid']."' and queued <> 1 ORDER BY pid DESC"); + $last_post = $DB->fetch_row(); + + $DB->query("UPDATE ibf_topics SET last_post='" .$last_post['post_date'] ."', ". + "last_poster_id='" .$last_post['author_id'] ."', ". + "last_poster_name='" .$last_post['author_name'] ."', ". + "posts=posts-1 WHERE tid='".$this->topic['tid']."'"); + + //--------------------------------------- + // If we deleted the last post in a topic that was + // the last post in a forum, best update that :D + //--------------------------------------- + + if ($this->forum['last_id'] == $this->topic['tid']) + { + $DB->query("SELECT title, tid, last_post, last_poster_id, last_poster_name " + ."FROM ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " + ."ORDER BY last_post DESC LIMIT 0,1"); + + $tt = $DB->fetch_row(); + + $db_string = $DB->compile_db_update_string( array( + last_title => $tt['title'] ? $tt['title'] : "", + last_id => $tt['tid'] ? $tt['tid'] : "", + last_post => $tt['last_post'] ? $tt['last_post'] : "", + last_poster_name => $tt['last_poster_name'] ? $tt['last_poster_name'] : "", + last_poster_id => $tt['last_poster_id'] ? $tt['last_poster_id'] : "", + ) ); + + $DB->query("UPDATE ibf_forums SET ".$db_string.",posts=posts-1 WHERE id='".$this->forum['id']."'"); + } + + $this->moderate_log("Deleted a post"); + + $print->redirect_screen( $ibforums->lang['post_deleted'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + + } + + function rebuild_topic() {} + + /*************************************************/ + // DELETE TOPIC: + // --------------- + // + /*************************************************/ + + function delete_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->topic['starter_id'] == $ibforums->member['id']) + { + if ($ibforums->member['g_delete_own_topics'] == 1) + { + $passed = 1; + } + } + + else if ($this->moderator['delete_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) { + $this->moderate_error(); + } + + $this->output = $this->html->delete_js(); + + $this->output .= $this->html_start_form( array( 1 => array( 'CODE', '08' ), + 2 => array( 't', $this->topic['tid'] ) + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['top_delete']." ".$this->forum['name']." > ".$this->topic['title'] ); + $this->output .= $this->html->mod_exp( $ibforums->lang['delete_topic'] ); + $this->output .= $this->html->end_form( $ibforums->lang['submit_delete'] ); + + $this->page_title = $ibforums->lang['t_delete'].": ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + function delete_topic() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) + { + $passed = 1; + } + else if ($this->moderator['delete_topic'] == 1) + { + $passed = 1; + } + else if ($this->topic['starter_id'] == $ibforums->member['id']) + { + if ($ibforums->member['g_delete_own_topics'] == 1) + { + $passed = 1; + } + } + else + { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) { + $this->moderate_error(); + } + + // Do we have a linked topic to remove? + + $DB->query("SELECT tid FROM ibf_topics WHERE state='link' AND moved_to='".$this->topic['tid'].'&'.$this->forum['id']."'"); + + if ( $linked_topic = $DB->fetch_row() ) + { + $DB->query("DELETE FROM ibf_topics WHERE tid='".$linked_topic['tid']."'"); + } + + + // Remove polls assigned to this topic + + $DB->query("DELETE FROM ibf_polls WHERE tid='".$this->topic['tid']."'"); + + // Remove poll voters + + $DB->query("DELETE FROM ibf_voters WHERE tid='".$this->topic['tid']."'"); + + // Remove the topic itself + + $DB->query("DELETE FROM ibf_topics WHERE tid='".$this->topic['tid']."'"); + + // Get the attach ID's and filenames + + $DB->query("SELECT attach_id, attach_hits, attach_file FROM ibf_posts WHERE attach_id <> '' AND topic_id='".$this->topic['tid']."'"); + + // Remove the attachments + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + if (is_file($this->upload_dir."/".$r['attach_id'])) + { + @unlink ($this->upload_dir."/".$r['attach_id']); + } + } + } + + // Remove the posts + + $DB->query("DELETE FROM ibf_posts WHERE topic_id='".$this->topic['tid']."'"); + + //------------------------------------------------ + // Update the forum topic/post and stat counters. + // + // We also need to make sure the last forum id and + // title is correct. + //------------------------------------------------ + + $DB->query("SELECT COUNT(tid) as tcount from ibf_topics WHERE approved=1"); + $topics = $DB->fetch_row(); + + $DB->query("SELECT COUNT(pid) as pcount from ibf_posts WHERE queued <> 1"); + $posts = $DB->fetch_row(); + + $DB->query("SELECT COUNT(tid) as tcount from ibf_topics WHERE approved=1 and forum_id='".$this->forum['id']."'"); + $f_topics = $DB->fetch_row(); + + $DB->query("SELECT COUNT(pid) as pcount from ibf_posts WHERE queued <> 1 and forum_id='".$this->forum['id']."'"); + $f_posts = $DB->fetch_row(); + + $this->forum['topics'] = $f_topics['tcount']; + $this->forum['posts'] = $f_posts['pcount'] - $f_topics['tcount']; + + $DB->query("SELECT title, tid, last_post, last_poster_id, last_poster_name " + ."FROM ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " + ."ORDER BY last_post DESC LIMIT 0,1"); + + $tt = $DB->fetch_row(); + + $db_string = $DB->compile_db_update_string( array( + last_title => $tt['title'] ? $tt['title'] : "", + last_id => $tt['tid'] ? $tt['tid'] : "", + last_post => $tt['last_post'] ? $tt['last_post'] : "", + last_poster_name => $tt['last_poster_name'] ? $tt['last_poster_name'] : "", + last_poster_id => $tt['last_poster_id'] ? $tt['last_poster_id'] : "", + topics => $this->forum['topics'], + posts => $this->forum['posts'] + ) ); + + $DB->query("UPDATE ibf_forums SET $db_string WHERE id='".$this->forum['id']."'"); + + // Update the main board stats. + + $posts = $posts['pcount'] - $topics['tcount']; + + $DB->query("UPDATE ibf_stats SET TOTAL_TOPICS='".$topics['tcount']."', TOTAL_REPLIES='".$posts."'"); + + $this->moderate_log("Deleted a topic"); + + $print->redirect_screen( $ibforums->lang['p_deleted'], "act=SF&f=".$this->forum['id'] ); + + } + + + /*************************************************/ + // EDIT TOPIC: + // --------------- + // + /*************************************************/ + + function edit_form() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['edit_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) + { + $this->moderate_error(); + } + + $this->output = $this->html_start_form( array( 1 => array( 'CODE', '12' ), + 2 => array( 't', $this->topic['tid'] ) + ) ); + + $this->output .= $this->html->table_top( $ibforums->lang['top_edit']." ".$this->forum['name']." > ".$this->topic['title'] ); + $this->output .= $this->html->mod_exp( $ibforums->lang['edit_topic'] ); + $this->output .= $this->html->topictitle_fields( $this->topic['title'], $this->topic['description'] ); + $this->output .= $this->html->end_form( $ibforums->lang['submit_edit'] ); + + $this->page_title = $ibforums->lang['t_edit'].": ".$this->topic['title']; + + $this->nav = array ( "{$this->forum['name']}", + "topic['tid']}'>{$this->topic['title']}" + ); + } + + function do_edit() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['edit_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + if (empty($this->topic['tid'])) { + $this->moderate_error(); + } + + if ($ibforums->input['TopicTitle'] == "") { + $std->Error( array( 'LEVEL' => 2, 'MSG' => 'no_topic_title' ) ); + } + + $topic_title = preg_replace( "/'/", "/\\'/", $ibforums->input['TopicTitle'] ); + $topic_desc = preg_replace( "/'/", "/\\'/", $ibforums->input['TopicDesc'] ); + + $DB->query("UPDATE ibf_topics SET title='$topic_title', description='$topic_desc' WHERE tid='".$this->topic['tid']."'"); + + if ($this->topic['tid'] == $this->forum['last_id']) + { + $DB->query("UPDATE ibf_forums SET last_title='$topic_title' WHERE id='".$this->forum['id']."'"); + } + + $this->moderate_log("Edited a topic title"); + + $print->redirect_screen( $ibforums->lang['p_edited'], "act=SF&f=".$this->forum['id'] ); + + + } + + + /*************************************************/ + // OPEN TOPIC: + // --------------- + // + /*************************************************/ + + function open_topic() { + global $std, $ibforums, $DB, $print; + + if ($this->topic['state'] == 'open') { + $this->moderate_error(); + } + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->topic['starter_id'] == $ibforums->member['id']) { + if ($ibforums->member['g_open_close_posts'] == 1) { + $passed = 1; + } + } + else + { + $passed = 0; + } + + if ($this->moderator['open_topic'] == 1) { + $passed = 1; + } + + + if ($passed != 1) $this->moderate_error(); + + $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'state', 'VALUE' => 'open' ) ); + + $this->moderate_log("Opened Topic"); + + $print->redirect_screen( $ibforums->lang['p_opened'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + + + + /*************************************************/ + // CLOSE TOPIC: + // --------------- + // + /*************************************************/ + + function close_topic() { + global $std, $ibforums, $DB, $print; + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->topic['starter_id'] == $ibforums->member['id']) { + if ($ibforums->member['g_open_close_posts'] == 1) { + $passed = 1; + } + } + else + { + $passed = 0; + } + + if ($this->moderator['close_topic'] == 1) { + $passed = 1; + } + + + if ($passed != 1) $this->moderate_error(); + + $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'state', 'VALUE' => 'closed' ) ); + + $this->moderate_log("Locked Topic"); + + $print->redirect_screen( $ibforums->lang['p_closed'], "act=SF&f=".$this->forum['id'] ); + + } + + + /*************************************************/ + // PIN TOPIC: + // --------------- + // + /*************************************************/ + + function pin_topic() { + global $std, $ibforums, $DB, $print; + + if ($this->topic['PIN_STATE'] == 1) { + $this->moderate_error(); + } + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['pin_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'pinned', 'VALUE' => '1' ) ); + + $this->moderate_log("Pinned Topic"); + + $print->redirect_screen( $ibforums->lang['p_pinned'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + + /*************************************************/ + // UNPIN TOPIC: + // --------------- + // + /*************************************************/ + + function unpin_topic() { + global $std, $ibforums, $DB, $print; + + if ($this->topic['pinned'] == 0) { + $this->moderate_error(); + } + + $passed = 0; + + if ($ibforums->member['g_is_supmod'] == 1) { + $passed = 1; + } + + else if ($this->moderator['unpin_topic'] == 1) { + $passed = 1; + } + else { + $passed = 0; + } + + if ($passed != 1) $this->moderate_error(); + + $this->alter_topic( array( 'TOPIC' => $this->topic['tid'], 'FIELD' => 'pinned', 'VALUE' => '0' ) ); + + $this->moderate_log("Unpinned Topic"); + + $print->redirect_screen( $ibforums->lang['p_unpinned'], "act=ST&f=".$this->forum['id']."&t=".$this->topic['tid']."&st=".$ibforums->input['st'] ); + + } + +//+--------------------------------------------------------------------------------------------- + + + /*************************************************/ + // MODERATE ERROR: + // --------------- + // + // Function for error messages in this script + // + /*************************************************/ + + function moderate_error($msg = 'moderate_no_permission') { + global $std; + + $std->Error( array( 'LEVEL' => 2, 'MSG' => $msg ) ); + + // Make sure we exit.. + + exit(); + } + + /*************************************************/ + // MODERATE LOG: + // --------------- + // + // Function for adding the mod action to the DB + // + /*************************************************/ + + function moderate_log($title = 'unknown') { + global $std, $ibforums, $DB, $HTTP_REFERER, $QUERY_STRING; + + $db_string = $std->compile_db_string( array ( + 'forum_id' => $ibforums->input['f'], + 'topic_id' => $ibforums->input['t'], + 'post_id' => $ibforums->input['p'], + 'member_id' => $ibforums->member['id'], + 'member_name' => $ibforums->member['name'], + 'ip_address' => $ibforums->input['IP_ADDRESS'], + 'http_referer'=> $HTTP_REFERER, + 'ctime' => time(), + 'topic_title' => $this->topic['title'], + 'action' => $title, + 'query_string'=> $QUERY_STRING, + ) + ); + + $DB->query("INSERT INTO ibf_moderator_logs (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + } + + + /*************************************************/ + // Re Count topics for the forums: + // --------------- + // + // Handles simple moderation functions, saves on + // writing the same code over and over. + // ASS_U_ME's that the requesting user has been + // authenticated by this stage. + // + /*************************************************/ + + function recount($fid="") { + global $ibforums, $root_path, $DB, $std; + + if ($fid == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'move_no_source' ) ); + } + + // Get the topics.. + + $DB->query("SELECT COUNT(tid) as count FROM ibf_topics WHERE approved=1 and forum_id='".$fid."'"); + $topics = $DB->fetch_row(); + + // Get the posts.. + + $DB->query("SELECT COUNT(pid) as count FROM ibf_posts WHERE queued <> 1 and forum_id='".$fid."'"); + $posts = $DB->fetch_row(); + + // Get the forum last poster.. + + $DB->query("SELECT tid, title, last_poster_id, last_poster_name, last_post FROM ibf_topics WHERE approved=1 and forum_id='".$fid."' ORDER BY last_post DESC LIMIT 0,1"); + $last_post = $DB->fetch_row(); + + // Reset this forums stats + + $db_string = $DB->compile_db_update_string( array ( + 'last_poster_id' => $last_post['last_poster_id'], + 'last_poster_name' => $last_post['last_poster_name'], + 'last_post' => $last_post['last_post'], + 'last_title' => $last_post['title'], + 'last_id' => $last_post['tid'], + 'topics' => $topics['count'], + 'posts' => $posts['count'] + ) ); + + $DB->query("UPDATE ibf_forums SET $db_string WHERE id='".$fid."'"); + + } + + + /*************************************************/ + // ALTER TOPIC: + // --------------- + // + // Handles simple moderation functions, saves on + // writing the same code over and over. + // ASS_U_ME's that the requesting user has been + // authenticated by this stage. + // + /*************************************************/ + + function alter_topic( $data = array() ) { + global $ibforums, $DB; + + if ( $data['FIELD'] == "" ) return -1; + if ( $data['VALUE'] == "" ) return -1; + if ( $data['TOPIC'] == "" ) return -1; + + if ($data['TOPIC'] < 1) return -1; + + $data['VALUE'] = preg_replace( "/'/", "\\'", $data['VALUE'] ); + + $DB->query("UPDATE ibf_topics SET ".$data['FIELD']."='".$data['VALUE']."' WHERE tid='".$data['TOPIC']."'"); + } + + /*****************************************************/ + // HTML: start form. + // ------------------ + // Returns the HTML for the opening tag + /*****************************************************/ + + function html_start_form($additional_tags=array()) { + global $ibforums; + + $form = "". + "". + "". + "". + ""; + + // Any other tags to add? + + if (isset($additional_tags)) { + foreach($additional_tags as $k => $v) { + $form .= "\n"; + } + } + + return $form; + } + +} + +?> diff --git a/upload/sources/Online.php b/upload/sources/Online.php index 2f92dd08..be7e4c31 100644 --- a/upload/sources/Online.php +++ b/upload/sources/Online.php @@ -2,10 +2,10 @@ /* +-------------------------------------------------------------------------- -| IBFORUMS v1 +| Invision Board v1.1 | ======================================== -| by Matthew Mecham and David Baxter -| (c) 2001,2002 IBForums +| by Matthew Mecham +| (c) 2001,2002 Invision Power Services | http://www.ibforums.com | ======================================== | Web: http://www.ibforums.com @@ -54,9 +54,7 @@ class Online { $ibforums->lang = $std->load_words($ibforums->lang, 'lang_online', $ibforums->lang_id); - require "./Skin/".$ibforums->skin_id."/skin_online.php"; - - $this->html = new skin_online(); + $this->html = $std->load_template('skin_online'); $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; @@ -138,7 +136,9 @@ class Online { $DB->free_result(); - $t_time = time() - 900; + $cut_off = ($ibforums->vars['au_cutoff'] != "") ? $ibforums->vars['au_cutoff'] * 60 : 900; + + $t_time = time() - $cut_off; $DB->query("SELECT COUNT(id) as total_sessions FROM ibf_sessions WHERE login_type <> 1 AND running_time > $t_time"); $max = $DB->fetch_row(); @@ -158,9 +158,38 @@ class Online { // Grab all the current sessions. - $DB->query("SELECT s.id, s.member_name, s.member_id, s.running_time, s.location, s.member_group, g.prefix, g.suffix FROM ibf_sessions s, ibf_groups g WHERE login_type <> 1 AND running_time > $t_time AND s.member_group=g.g_id ORDER BY running_time DESC LIMIT ".$this->first.",25"); + $final = array(); + $tid_array = array(); - while( $sess = $DB->fetch_row() ) { + $topics = array(); + + $DB->query("SELECT s.id, s.in_forum, s.in_topic, s.member_name, s.member_id, s.ip_address, s.running_time, s.location, s.login_type, s.member_group, g.prefix, g.suffix FROM ibf_sessions s, ibf_groups g WHERE s.running_time > $t_time AND s.member_group=g.g_id ORDER BY running_time DESC LIMIT ".$this->first.",25"); + + while( $r = $DB->fetch_row() ) + { + $final[] = $r; + + if ($r['in_topic'] != "") + { + $tid_array[] = $r['in_topic']; + } + } + + if ( count($tid_array) > 0 ) + { + $tid_string = implode( ",", $tid_array ); + + $DB->query("SELECT tid, title FROM ibf_topics WHERE tid IN ($tid_string)"); + + while ( $t = $DB->fetch_row() ) + { + $topics[ $t['tid'] ] = $t['title']; + } + } + + + foreach( $final as $idx => $sess ) + { //---------------------------------------------------- // Is this a member, and have we seen them before? @@ -169,6 +198,20 @@ class Online { // their IP address changes. //---------------------------------------------------- + $inv = ''; + + if ($sess['login_type'] == 1) + { + if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_admin_anon'] != 1) ) + { + $inv = '*'; + } + else + { + continue; + } + } + if (! empty($sess['member_name']) ) { if (isset($this->seen_name[ $sess['member_name'] ]) ) @@ -186,7 +229,9 @@ class Online { $line = ""; - list($act, $fid, $tid, $pid) = explode( ",", $sess['location'] ); + list($act, $pid) = explode( ",", $sess['location'] ); + $fid = $sess['in_forum']; + $tid = $sess['in_topic']; if (isset($act)) { @@ -195,7 +240,7 @@ class Online { } - if ($fid != "") + if ($fid != "" and ($act == 'SF' or $act == 'ST' or $act == 'Post')) { $pass = 0; @@ -210,9 +255,9 @@ class Online { if ($pass == 1) { - if ($tid != "") + if ($tid > 0) { - $line .= " {$this->forums[ $fid ]['name']}"; + $line .= " {$topics[$tid]}"; } else { @@ -221,7 +266,7 @@ class Online { } else { - $line .= " ".$ibforums->lang['n_a']; + $line = " {$ibforums->lang['board_index']}"; } } @@ -234,9 +279,18 @@ class Online { $sess['where_line'] = $line; + if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_online_ip'] != 1) ) + { + $sess['ip_address'] = " ( ".$sess['ip_address']." )"; + } + else + { + $sess['ip_address'] = ""; + } + if (isset($sess['member_id'])) { - $sess['member_name'] = "{$sess['prefix']}{$sess['member_name']}{$sess['suffix']}"; + $sess['member_name'] = "{$sess['prefix']}{$sess['member_name']}{$sess['suffix']}$inv {$sess['ip_address']}"; } $sess['running_time'] = $std->get_date( $sess['running_time'], 'LONG' ); @@ -257,11 +311,11 @@ class Online { if ($sess['member_name'] and $sess['member_id']) { - $sess['msg_icon'] = "{$ibforums->skin['P_MSG']}"; + $sess['msg_icon'] = "<{P_MSG}>"; } else { - $sess['member_name'] = $sess['prefix'].$ibforums->lang['guest'].$sess['suffix']; + $sess['member_name'] = $sess['prefix'].$ibforums->lang['guest'].$sess['suffix']." ".$sess['ip_address']; $sess['msg_icon'] = ' '; } diff --git a/upload/sources/Post.php b/upload/sources/Post.php index f66096ed..b5d9eb60 100644 --- a/upload/sources/Post.php +++ b/upload/sources/Post.php @@ -1,930 +1,1032 @@ - Post core module -| > Module written by Matt Mecham -| > Date started: 14th February 2002 -| -| > Module Version 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Post; - -class Post { - - var $output = ""; - var $base_url = ""; - var $html = ""; - var $parser = ""; - var $moderator = array(); - var $forum = array(); - var $topic = array(); - var $category = array(); - var $mem_groups = array(); - var $mem_titles = array(); - var $obj = array(); - var $email = ""; - - /***********************************************************************************/ - // - // Our constructor, load words, load skin, print the topic listing - // - /***********************************************************************************/ - - function Post() { - - - global $ibforums, $DB, $std, $print, $skin_universal; - - require "./Skin/".$ibforums->skin_id."/skin_post.php"; - - require "./sources/lib/post_parser.php"; - - $this->parser = new post_parser(1); - - - //-------------------------------------- - // Compile the language file - //-------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); - - $this->html = new skin_post(); - - //-------------------------------------- - // Check the input - //-------------------------------------- - - if ($ibforums->input['t']) - { - $ibforums->input['t'] = $std->is_number($ibforums->input['t']); - if (! $ibforums->input['t'] ) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - } - - if ($ibforums->input['p']) - { - $ibforums->input['p'] = $std->is_number($ibforums->input['p']); - if (! $ibforums->input['p'] ) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - } - - $ibforums->input['f'] = $std->is_number($ibforums->input['f']); - if (! $ibforums->input['f'] ) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - - $ibforums->input['st'] = $ibforums->input['st'] ? $std->is_number($ibforums->input['st']) : 0; - - // Did the user press the "preview" button? - - $this->obj['preview_post'] = $ibforums->input['preview']; - - - //-------------------------------------- - // Get the forum info based on the forum ID, get the category name, ID, and get the topic details - //-------------------------------------- - - $DB->query("SELECT f.*, c.id as cat_id, c.name as cat_name from ibf_forums f, ibf_categories c WHERE f.id=".$ibforums->input[f]." and c.id=f.category"); - - $this->forum = $DB->fetch_row(); - - if ($this->forum['read_perms'] != '*') - { - if (! preg_match("/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) ) - { - $std->Error( array( LEVEL => 1, MSG => 'no_view_topic') ); - } - - } - - // Is this forum switched off? - - if ( ! $this->forum['status'] ) - { - $std->Error( array( LEVEL => 1, MSG => 'forum_read_only') ); - } - - //-------------------------------------- - // Is this a password protected forum? - //-------------------------------------- - - $pass = 0; - - if ($this->forum['password'] != "") - { - if ( ! $c_pass = $std->my_getcookie('iBForum'.$this->forum['id']) ) - { - $pass = 0; - } - - if ( $c_pass == $this->forum['password'] ) - { - $pass = 1; - } - else - { - $pass = 0; - } - } - else - { - $pass = 1; - } - - if ($pass == 0) - { - $std->Error( array( LEVEL => 1, MSG => 'no_view_topic') ); - } - - //-------------------------------------- - - if ($this->forum['parent_id'] > 0) - { - - $DB->query("SELECT f.id as forum_id, f.name as forum_name, c.id, c.name FROM ibf_forums f, ibf_categories c WHERE f.id='".$this->forum['parent_id']."' AND c.id=f.category"); - - $row = $DB->fetch_row(); - - $this->forum['cat_id'] = $row['id']; - $this->forum['cat_name'] = $row['name']; - - } - - - //-------------------------------------- - // Error out if we can not find the forum - //-------------------------------------- - - if (!$this->forum['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - //-------------------------------------- - // Is this forum moderated? - //-------------------------------------- - - $this->obj['moderate'] = $this->forum['preview_posts'] ? 1 : 0; - // Can we bypass it? - if ($ibforums->member['g_avoid_q']) - { - $this->obj['moderate'] = 0; - } - - //-------------------------------------- - // Are we allowed to post at all? - //-------------------------------------- - - if ($ibforums->member['id']) - { - if (!$ibforums->member['allow_post']) - { - $std->Error( array( LEVEL => 1, MSG => 'posting_off') ); - } - - // Flood check.. - - if ( $ibforums->input['CODE'] != "08" and $ibforums->input['CODE'] != "09" ) - { - if ( $ibforums->vars['flood_control'] > 0 ) - { - if ($ibforums->member['g_avoid_flood'] != 1) - { - if ( time() - $ibforums->member['last_post'] < $ibforums->vars['flood_control'] ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'flood_control' , 'EXTRA' => $ibforums->vars['flood_control'] ) ); - } - } - } - - } - - } - - if ($ibforums->member['id'] != 0 and $ibforums->member['g_is_supmod'] == 0) - { - $DB->query("SELECT * from ibf_moderators WHERE member_id='".$ibforums->member['id']."' AND forum_id='".$this->forum['id']."'"); - $this->moderator = $DB->fetch_row(); - } - - //-------------------------------------- - // Convert the code ID's into something - // use mere mortals can understand.... - //-------------------------------------- - - $this->obj['action_codes'] = array ( '00' => array( '0' , 'new_post' ), - '01' => array( '1' , 'new_post' ), - '02' => array( '0' , 'reply_post' ), - '03' => array( '1' , 'reply_post' ), - '06' => array( '0' , 'q_reply_post' ), - '07' => array( '1' , 'q_reply_post' ), - '08' => array( '0' , 'edit_post' ), - '09' => array( '1' , 'edit_post' ), - '10' => array( '0' , 'poll' ), - '11' => array( '1' , 'poll' ), - ); - - // Make sure our input CODE element is legal. - - if (! isset($this->obj['action_codes'][ $ibforums->input['CODE'] ]) ) - { - $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); - } - - // Require and run our associated library file for this action. - // this imports an extended class for this Post class. - - require "./sources/lib/post_" . $this->obj['action_codes'][ $ibforums->input['CODE'] ][1] . ".php"; - - $post_functions = new post_functions(&$this); - - // If the first CODE array bit is set to "0" - show the relevant form. - // If it's set to "1" process the input. - - // We pass a reference to this classes object so we can manipulate this classes - // data from our sub class. - - if ($this->obj['action_codes'][ $ibforums->input['CODE'] ][0]) - { - // Make sure we have a "Guest" Name.. - - if (!$ibforums->member['id']) - { - - $ibforums->input['UserName'] = trim($ibforums->input['UserName']); - $ibforums->input['UserName'] = str_replace( "
    ", "", $ibforums->input['UserName']); - $ibforums->input['UserName'] = $ibforums->input['UserName'] ? $ibforums->input['UserName'] : 'Guest'; - - if ($ibforums->input['UserName'] != 'Guest') - { - $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".trim(strtolower($ibforums->input['UserName']))."'"); - - if ( $DB->get_num_rows() ) - { - $ibforums->input['UserName'] = $ibforums->vars['guest_name_pre'].$ibforums->input['UserName'].$ibforums->vars['guest_name_suf']; - } - } - - } - - //------------------------------------------------------------------------- - // Stop the user hitting the submit button in the hope that multiple topics - // or replies will be added. Or if the user accidently hits the button - // twice. - //------------------------------------------------------------------------- - - if ( $this->obj['preview_post'] == "" ) - { - - if ( preg_match( "/Post,.*,(01|03|07|11)$/", $ibforums->location ) ) - { - if ( time() - $ibforums->lastclick < 2 ) - { - if ( $ibforums->input['CODE'] == '01' or $ibforums->input['CODE'] == '11' ) - { - // Redirect to the newest topic in the forum - - - $DB->query("SELECT tid from ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " - ."ORDER BY last_post DESC LIMIT 0,1"); - - $topic = $DB->fetch_row(); - - $std->boink_it($ibforums->base_url."&act=ST&f=".$this->forum['id']."&t=".$topic['tid']); - exit(); - } - else - { - // It's a reply, so simply show the topic... - - $std->boink_it($ibforums->base_url."&act=ST&f=".$this->forum['id']."&t=".$ibforums->input['t']."&view=getlastpost"); - exit(); - } - } - } - - } - - //---------------------------------- - - $post_functions->process(&$this); - } - else - { - $post_functions->show_form(&$this); - } - - - - } - - /*****************************************************/ - // topic tracker - // ------------------ - // Checks and sends out the emails as needed. - /*****************************************************/ - - function topic_tracker($tid="", $post="", $poster="") - { - global $ibforums, $DB, $std; - - require "./sources/lib/emailer.php"; - - $this->email = new emailer(); - - //-------------------------- - - if ($tid == "") - { - return TRUE; - } - - // Configure the date - $getdate = time() - (60*60*24); - - // Get the email addy's, topic ids and email_full stuff - oh yeah. - - $DB->query("SELECT tr.trid, tr.topic_id, m.name, m.email, m.id, m.email_full, m.language, t.title, t.forum_id FROM ibf_tracker tr, ibf_topics t,ibf_members m WHERE tr.topic_id='$tid' AND tr.member_id=m.id AND t.tid=tr.topic_id AND (tr.last_sent < '$getdate' or tr.last_sent=0)"); - - if ( $DB->get_num_rows() ) - { - $trids = array(); - - while ( $r = $DB->fetch_row() ) - { - - $r['language'] = $r['language'] ? $r['language'] : 'en'; - - // We don't want to be notified of our own posts, so.. - - if ($r['id'] == $ibforums->member['id']) - { - continue; - } - - //----------------------------------------------------- - - if ($r['email_full'] == 1) - { - - $this->email->get_template("subs_with_post", $r['language']); - - $this->email->build_message( array( - 'TOPIC_ID' => $r['topic_id'], - 'FORUM_ID' => $r['forum_id'], - 'TITLE' => $r['title'], - 'NAME' => $r['name'], - 'POSTER' => $poster, - 'POST' => $post, - ) - ); - - $this->email->subject = $ibforums->lang['tt_subject']; - $this->email->to = $r['email']; - $this->email->send_mail(); - - } - else - { - - $this->email->get_template("subs_no_post", $r['language']); - - $this->email->build_message( array( - 'TOPIC_ID' => $r['topic_id'], - 'FORUM_ID' => $r['forum_id'], - 'TITLE' => $r['title'], - 'NAME' => $r['name'], - 'POSTER' => $poster, - ) - ); - - $this->email->subject = $ibforums->lang['tt_subject']; - $this->email->to = $r['email']; - - $this->email->send_mail(); - - } - - $trids[] = $r['trid']; - } - - // Update the DB wid' da new time, innit. - - $trid_string = implode( ",", $trids ); - - if ( count($trids) > 0 ) - { - - $DB->query("UPDATE ibf_tracker SET last_sent='".time()."' WHERE trid IN(".$trid_string.")"); - } - - } - - return TRUE; - - } - - /*****************************************************/ - // compile post - // ------------------ - // Compiles all the incoming information into an array - // which is returned to the accessor - /*****************************************************/ - - function compile_post() { - global $ibforums, $std, $REQUEST_METHOD, $HTTP_POST_VARS; - - $ibforums->vars['max_post_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; - - // sort out some of the form data, check for posting length, etc. - // THIS MUST BE CALLED BEFORE CHECKING ATTACHMENTS - - $ibforums->input['enablesig'] = $ibforums->input['enablesig'] == 'yes' ? 1 : 0; - $ibforums->input['enableemo'] = $ibforums->input['enableemo'] == 'yes' ? 1 : 0; - - // Do we have a valid post? - - if (strlen( trim($HTTP_POST_VARS['Post']) ) < 1) { - $std->Error( array( LEVEL => 1, MSG => 'no_post') ); - } - - if (strlen( $HTTP_POST_VARS['Post'] ) > ($ibforums->vars['max_post_length']*1024)) { - $std->Error( array( LEVEL => 1, MSG => 'post_too_long') ); - } - - $post = array( - 'author_id' => $ibforums->member['id'] ? $ibforums->member['id'] : 0, - 'use_sig' => $ibforums->input['enablesig'], - 'use_emo' => $ibforums->input['enableemo'], - 'ip_address' => $ibforums->input['IP_ADDRESS'], - 'post_date' => time(), - 'icon_id' => $ibforums->input['iconid'], - 'post' => $this->parser->convert( array( TEXT => $ibforums->input['Post'], - SMILIES => $ibforums->input['enableemo'], - CODE => $this->forum['use_ibc'], - HTML => $this->forum['use_html'] - ) - ), - 'author_name' => $ibforums->member['id'] ? $ibforums->member['name'] : $ibforums->input['UserName'], - 'forum_id' => $this->forum['id'], - 'topic_id' => "", - 'queued' => $this->obj['moderate'], - 'attach_id' => "", - 'attach_hits' => "", - 'attach_type' => "", - ); - - // If we had any errors, parse them back to this class - // so we can track them later. - - $this->obj['post_errors'] = $this->parser->error; - - return $post; - } - - /*****************************************************/ - // process upload - // ------------------ - // checks for an entry in the upload field, and uploads - // the file if it meets our criteria. This also inserts - // a new row into the attachments database if successful - /*****************************************************/ - - function process_upload() { - - global $ibforums, $std, $HTTP_POST_FILES, $DB, $FILE_UPLOAD; - - //------------------------------------------------- - // Set up some variables to stop carpals developing - //------------------------------------------------- - - $FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name']; - $FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size']; - $FILE_TYPE = $HTTP_POST_FILES['FILE_UPLOAD']['type']; - - // Naughty Opera adds the filename on the end of the - // mime type - we don't want this. - - $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); - - $attach_data = array( 'attach_id' => "", - 'attach_hits' => "", - 'attach_type' => "", - 'attach_file' => "", - ); - - //------------------------------------------------- - // Return if we don't have a file to upload - //------------------------------------------------- - - // Naughty Mozilla likes to use "none" to indicate an empty upload field. - // I love universal languages that aren't universal. - - if ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "" or !$HTTP_POST_FILES['FILE_UPLOAD']['name'] or ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "none") ) return $attach_data; - - //------------------------------------------------- - // Return empty handed if we don't have permission to use - // uploads - //------------------------------------------------- - - if ( (!$this->forum['use_attach']) and ($ibforums->member['g_attach_max'] < 1) ) return $attach_data; - - //------------------------------------------------- - // Load our mime types config file. - //------------------------------------------------- - - require "./conf_mime_types.php"; - - //------------------------------------------------- - // Are we allowing this type of file? - //------------------------------------------------- - - if ($mime_types[ $FILE_TYPE ][0] != 1) - { - $this->obj['post_errors'] = 'invalid_mime_type'; - return $attach_data; - } - - //------------------------------------------------- - // Check the file size - //------------------------------------------------- - - if ($FILE_SIZE > ($ibforums->member['g_attach_max']*1024)) - { - $std->Error( array( LEVEL => 1, MSG => 'upload_to_big') ); - } - - //------------------------------------------------- - // Make the uploaded file safe - //------------------------------------------------- - - $FILE_NAME = preg_replace( "/[^\w\.]/", "_", $FILE_NAME ); - - $real_file_name = "post-".$this->forum['id']."-".time(); // Note the lack of extension! - - if (preg_match( "/\.(cgi|pl|js|asp|php|html|htm|jsp|jar)/", $FILE_NAME )) - { - $FILE_TYPE = 'text/plain'; - } - - //------------------------------------------------- - // Add on the extension... - //------------------------------------------------- - - $ext = '.ibf'; - - switch($FILE_TYPE) - { - case 'image/gif': - $ext = '.gif'; - break; - case 'image/jpeg': - $ext = '.jpg'; - break; - case 'image/pjpeg': - $ext = '.jpg'; - break; - case 'image/x-png': - $ext = '.png'; - break; - default: - $ext = '.ibf'; - break; - } - - $real_file_name .= $ext; - - //------------------------------------------------- - // If we are previewing the post, we don't want to - // add the attachment to the database, so we return - // the array with the filename. We would have returned - // earlier if there was an error - //------------------------------------------------- - - if ($this->obj['preview_post']) - { - return array( 'FILE_NAME' => $FILE_NAME ); - } - - //------------------------------------------------- - // Copy the upload to the uploads directory - //------------------------------------------------- - - if (! @move_uploaded_file( $HTTP_POST_FILES['FILE_UPLOAD']['tmp_name'], $ibforums->vars['upload_dir']."/".$real_file_name) ) - { - $this->obj['post_errors'] = 'upload_failed'; - return $attach_data; - } - - //------------------------------------------------- - // set the array, and enter the info into the DB - // We don't have an extension on the file in the - // hope that it make it more difficult to execute - // a script on our server. - //------------------------------------------------- - - $attach_data['attach_id'] = $real_file_name; - $attach_data['attach_hits'] = 0; - $attach_data['attach_type'] = $FILE_TYPE; - $attach_data['attach_file'] = $FILE_NAME; - - return $attach_data; - } - - - - /*****************************************************/ - // check_upload_ability - // ------------------ - // checks to make sure the requesting browser can accept - // file uploads, also checks if the member group can - // accept uploads and returns accordingly. - /*****************************************************/ - - function check_upload_ability() { - global $ibforums; - - if ($this->forum['use_attach'] and $ibforums->member['g_attach_max'] > 0) - { - $this->obj['can_upload'] = 1; - $this->obj['form_extra'] = " enctype='multipart/form-data'"; - $this->obj['hidden_field'] = ""; - } - - } - - /*****************************************************/ - // HTML: mod_options. - // ------------------ - // Returns the HTML for the mod options drop down box - /*****************************************************/ - - function mod_options() { - global $ibforums, $DB; - - $can_close = 0; - $can_pin = 0; - - $html = "". - "". - "". - "". - $this->obj['hidden_field']; - - // Any other tags to add? - - if (isset($additional_tags)) { - foreach($additional_tags as $k => $v) { - $form .= "\n"; - } - } - - return $form; - } - - /*****************************************************/ - // HTML: name fields. - // ------------------ - // Returns the HTML for either text inputs or membername - // depending if the member is a guest. - /*****************************************************/ - - function html_name_field() { - global $ibforums; - - return $ibforums->member['id'] ? $this->html->nameField_reg() : $this->html->nameField_unreg( $ibforums->input[UserName] ); - } - - /*****************************************************/ - // HTML: Post body. - // ------------------ - // Returns the HTML for post area, code buttons and - // post icons - /*****************************************************/ - - function html_post_body($raw_post="") { - global $ibforums; - - $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; - - return $this->html->postbox_buttons($raw_post); - - } - - /*****************************************************/ - // HTML: Post Icons - // ------------------ - // Returns the HTML for post area, code buttons and - // post icons - /*****************************************************/ - - function html_post_icons($post_icon="") { - global $ibforums; - - if ($ibforums->input['iconid']) - { - $post_icon = $ibforums->input['iconid']; - } - - $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; - - $html = $this->html->PostIcons(); - - if ($post_icon) { - $html = preg_replace( "/name=[\"']iconid[\"']\s*value=[\"']$post_icon\s?[\"']/", "name='iconid' value='$post_icon' checked", $html ); - $html = preg_replace( "/name=[\"']iconid[\"']\s*value=[\"']0[\"']\s*checked/i" , "name='iconid' value='0'", $html ); - } - return $html; - } - - /*****************************************************/ - // HTML: add smilie box. - // ------------------ - // Inserts the clickable smilies box - /*****************************************************/ - - function html_add_smilie_box() { - global $ibforums, $DB; - - $show_table = 0; - $count = 0; - $smilies = "\n"; - - // Get the smilies from the DB - - $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); - - while ($elmo = $DB->fetch_row() ) { - - $show_table++; - $count++; - - $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; - - if ($count == $ibforums->vars['emo_per_row']) { - $smilies .= "\n\n"; - $count = 0; - } - } - - if ($count != $ibforums->vars['emo_per_row']) { - for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { - $smilies .= " \n"; - } - $smilies .= ""; - } - - $table = $this->html->smilie_table(); - - if ($show_table != 0) { - $table = preg_replace( "//", $smilies, $table ); - $this->output = preg_replace( "//", $table, $this->output ); - } - - } - - /*****************************************************/ - // HTML: topic summary. - // ------------------ - // displays the last 10 replies to the topic we're - // replying in. - /*****************************************************/ - - function html_topic_summary($topic_id) { - - global $ibforums, $std, $DB; - - if (! $topic_id ) return; - - $cached_members = array(); - - $this->output .= $this->html->TopicSummary_top(); - - //-------------------------------------------------------------- - // Get the posts - // This section will probably change at some point - //-------------------------------------------------------------- - - $post_query = $DB->query("SELECT post, pid, post_date, author_id, author_name FROM ibf_posts WHERE topic_id='$topic_id' and queued <> 1 ORDER BY pid DESC LIMIT 0,10"); - - while ( $row = $DB->fetch_row($post_query) ) - { - - $row['author'] = $row['author_name']; - - $row['date'] = $std->get_date( $row['post_date'], 'LONG' ); - - $this->output .= $this->html->TopicSummary_body( $row ); - } - - $this->output .= $this->html->TopicSummary_bottom(); - - } - - /*****************************************************/ - // Moderators log - // ------------------ - // Simply adds the last action to the mod logs - /*****************************************************/ - - function moderate_log($title = 'unknown', $topic_title) { - global $std, $ibforums, $DB, $HTTP_REFERER, $QUERY_STRING; - - $db_string = $std->compile_db_string( array ( - 'forum_id' => $ibforums->input['f'], - 'topic_id' => $ibforums->input['t'], - 'post_id' => $ibforums->input['p'], - 'member_id' => $ibforums->member['id'], - 'member_name' => $ibforums->member['name'], - 'ip_address' => $ibforums->input['IP_ADDRESS'], - 'http_referer'=> $HTTP_REFERER, - 'ctime' => time(), - 'topic_title' => $topic_title, - 'action' => $title, - 'query_string'=> $QUERY_STRING, - ) - ); - - $DB->query("INSERT INTO ibf_moderator_logs (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - } - -} - + Post core module +| > Module written by Matt Mecham +| > Date started: 14th February 2002 +| +| > Module Version 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Post; + +class Post { + + var $output = ""; + var $base_url = ""; + var $html = ""; + var $parser = ""; + var $moderator = array(); + var $forum = array(); + var $topic = array(); + var $category = array(); + var $mem_groups = array(); + var $mem_titles = array(); + var $obj = array(); + var $email = ""; + var $can_upload = 0; + + /***********************************************************************************/ + // + // Our constructor, load words, load skin, print the topic listing + // + /***********************************************************************************/ + + function Post() { + + + global $ibforums, $DB, $std, $print, $skin_universal; + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(1); + + //-------------------------------------- + // Compile the language file + //-------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); + + $this->html = $std->load_template('skin_post'); + + //-------------------------------------- + // Check the input + //-------------------------------------- + + if ($ibforums->input['t']) + { + $ibforums->input['t'] = $std->is_number($ibforums->input['t']); + if (! $ibforums->input['t'] ) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + } + + if ($ibforums->input['p']) + { + $ibforums->input['p'] = $std->is_number($ibforums->input['p']); + if (! $ibforums->input['p'] ) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + } + + $ibforums->input['f'] = $std->is_number($ibforums->input['f']); + if (! $ibforums->input['f'] ) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + + $ibforums->input['st'] = $ibforums->input['st'] ? $std->is_number($ibforums->input['st']) : 0; + + // Did the user press the "preview" button? + + $this->obj['preview_post'] = $ibforums->input['preview']; + + + //-------------------------------------- + // Get the forum info based on the forum ID, get the category name, ID, and get the topic details + //-------------------------------------- + + $DB->query("SELECT f.*, c.id as cat_id, c.name as cat_name from ibf_forums f, ibf_categories c WHERE f.id=".$ibforums->input[f]." and c.id=f.category"); + + $this->forum = $DB->fetch_row(); + + if ($this->forum['read_perms'] != '*') + { + if (! preg_match("/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['read_perms'] ) ) + { + $std->Error( array( LEVEL => 1, MSG => 'no_view_topic') ); + } + + } + + // Can we upload stuff? + + if ($this->forum['upload_perms'] == '*') + { + $this->can_upload = 1; + } + else if ( preg_match("/(^|,)".$ibforums->member['mgroup']."(,|$)/", $this->forum['upload_perms'] ) ) + { + $this->can_upload = 1; + } + + // Is this forum switched off? + + if ( ! $this->forum['status'] ) + { + $std->Error( array( LEVEL => 1, MSG => 'forum_read_only') ); + } + + //-------------------------------------- + // Is this a password protected forum? + //-------------------------------------- + + $pass = 0; + + if ($this->forum['password'] != "") + { + if ( ! $c_pass = $std->my_getcookie('iBForum'.$this->forum['id']) ) + { + $pass = 0; + } + + if ( $c_pass == $this->forum['password'] ) + { + $pass = 1; + } + else + { + $pass = 0; + } + } + else + { + $pass = 1; + } + + if ($pass == 0) + { + $std->Error( array( LEVEL => 1, MSG => 'no_view_topic') ); + } + + //-------------------------------------- + + if ($this->forum['parent_id'] > 0) + { + + $DB->query("SELECT f.id as forum_id, f.name as forum_name, c.id, c.name FROM ibf_forums f, ibf_categories c WHERE f.id='".$this->forum['parent_id']."' AND c.id=f.category"); + + $row = $DB->fetch_row(); + + $this->forum['cat_id'] = $row['id']; + $this->forum['cat_name'] = $row['name']; + + } + + + //-------------------------------------- + // Error out if we can not find the forum + //-------------------------------------- + + if (!$this->forum['id']) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + + //-------------------------------------- + // Is this forum moderated? + //-------------------------------------- + + $this->obj['moderate'] = $this->forum['preview_posts'] ? 1 : 0; + // Can we bypass it? + if ($ibforums->member['g_avoid_q']) + { + $this->obj['moderate'] = 0; + } + + // Does this member have mod_posts enabled? + + if ($ibforums->member['mod_posts'] == 1) + { + $this->obj['moderate'] = 1; + } + + //-------------------------------------- + // Are we allowed to post at all? + //-------------------------------------- + + if ($ibforums->member['id']) + { + if (!$ibforums->member['allow_post']) + { + $std->Error( array( LEVEL => 1, MSG => 'posting_off') ); + } + + // Flood check.. + + if ( $ibforums->input['CODE'] != "08" and $ibforums->input['CODE'] != "09" ) + { + if ( $ibforums->vars['flood_control'] > 0 ) + { + if ($ibforums->member['g_avoid_flood'] != 1) + { + if ( time() - $ibforums->member['last_post'] < $ibforums->vars['flood_control'] ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'flood_control' , 'EXTRA' => $ibforums->vars['flood_control'] ) ); + } + } + } + + } + + } + + if ($ibforums->member['id'] != 0 and $ibforums->member['g_is_supmod'] == 0) + { + $DB->query("SELECT * from ibf_moderators WHERE forum_id='".$this->forum['id']."' AND (member_id='".$ibforums->member['id']."' OR (is_group=1 AND group_id='".$ibforums->member['mgroup']."'))"); + $this->moderator = $DB->fetch_row(); + } + + //-------------------------------------- + // Convert the code ID's into something + // use mere mortals can understand.... + //-------------------------------------- + + $this->obj['action_codes'] = array ( '00' => array( '0' , 'new_post' ), + '01' => array( '1' , 'new_post' ), + '02' => array( '0' , 'reply_post' ), + '03' => array( '1' , 'reply_post' ), + '06' => array( '0' , 'q_reply_post' ), + '07' => array( '1' , 'q_reply_post' ), + '08' => array( '0' , 'edit_post' ), + '09' => array( '1' , 'edit_post' ), + '10' => array( '0' , 'poll' ), + '11' => array( '1' , 'poll' ), + ); + + // Make sure our input CODE element is legal. + + if (! isset($this->obj['action_codes'][ $ibforums->input['CODE'] ]) ) + { + $std->Error( array( LEVEL => 1, MSG => 'missing_files') ); + } + + // Require and run our associated library file for this action. + // this imports an extended class for this Post class. + + require "./sources/lib/post_" . $this->obj['action_codes'][ $ibforums->input['CODE'] ][1] . ".php"; + + $post_functions = new post_functions(&$this); + + // If the first CODE array bit is set to "0" - show the relevant form. + // If it's set to "1" process the input. + + // We pass a reference to this classes object so we can manipulate this classes + // data from our sub class. + + if ($this->obj['action_codes'][ $ibforums->input['CODE'] ][0]) + { + // Make sure we have a "Guest" Name.. + + if (!$ibforums->member['id']) + { + + $ibforums->input['UserName'] = trim($ibforums->input['UserName']); + $ibforums->input['UserName'] = str_replace( "
    ", "", $ibforums->input['UserName']); + $ibforums->input['UserName'] = $ibforums->input['UserName'] ? $ibforums->input['UserName'] : 'Guest'; + + if ($ibforums->input['UserName'] != 'Guest') + { + $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".trim(strtolower($ibforums->input['UserName']))."'"); + + if ( $DB->get_num_rows() ) + { + $ibforums->input['UserName'] = $ibforums->vars['guest_name_pre'].$ibforums->input['UserName'].$ibforums->vars['guest_name_suf']; + } + } + + } + + //------------------------------------------------------------------------- + // Stop the user hitting the submit button in the hope that multiple topics + // or replies will be added. Or if the user accidently hits the button + // twice. + //------------------------------------------------------------------------- + + if ( $this->obj['preview_post'] == "" ) + { + + if ( preg_match( "/Post,.*,(01|03|07|11)$/", $ibforums->location ) ) + { + if ( time() - $ibforums->lastclick < 2 ) + { + if ( $ibforums->input['CODE'] == '01' or $ibforums->input['CODE'] == '11' ) + { + // Redirect to the newest topic in the forum + + + $DB->query("SELECT tid from ibf_topics WHERE forum_id='".$this->forum['id']."' AND approved=1 " + ."ORDER BY last_post DESC LIMIT 0,1"); + + $topic = $DB->fetch_row(); + + $std->boink_it($ibforums->base_url."&act=ST&f=".$this->forum['id']."&t=".$topic['tid']); + exit(); + } + else + { + // It's a reply, so simply show the topic... + + $std->boink_it($ibforums->base_url."&act=ST&f=".$this->forum['id']."&t=".$ibforums->input['t']."&view=getlastpost"); + exit(); + } + } + } + + } + + //---------------------------------- + + $post_functions->process(&$this); + } + else + { + $post_functions->show_form(&$this); + } + + + + } + + /*****************************************************/ + // topic tracker + // ------------------ + // Checks and sends out the emails as needed. + /*****************************************************/ + + function topic_tracker($tid="", $post="", $poster="", $last_post="" ) + { + global $ibforums, $DB, $std; + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + //------------------------- + + if ($tid == "") + { + return TRUE; + } + + // Get the email addy's, topic ids and email_full stuff - oh yeah. + // We only return rows that have a member last_activity of greater than the post itself + + $DB->query("SELECT tr.trid, tr.topic_id, m.name, m.email, m.id, m.email_full, m.language, m.last_activity, t.title, t.forum_id + FROM ibf_tracker tr, ibf_topics t,ibf_members m + WHERE tr.topic_id='$tid' + AND tr.member_id=m.id + AND m.id <> '{$ibforums->member['id']}' + AND t.tid=tr.topic_id + AND m.last_activity > '$last_post'"); + + if ( $DB->get_num_rows() ) + { + $trids = array(); + + while ( $r = $DB->fetch_row() ) + { + + $r['language'] = $r['language'] ? $r['language'] : 'en'; + + if ($r['email_full'] == 1) + { + + $this->email->get_template("subs_with_post", $r['language']); + + $this->email->build_message( array( + 'TOPIC_ID' => $r['topic_id'], + 'FORUM_ID' => $r['forum_id'], + 'TITLE' => $r['title'], + 'NAME' => $r['name'], + 'POSTER' => $poster, + 'POST' => $post, + ) + ); + + $this->email->subject = $ibforums->lang['tt_subject']; + $this->email->to = $r['email']; + $this->email->send_mail(); + + } + else + { + + $this->email->get_template("subs_no_post", $r['language']); + + $this->email->build_message( array( + 'TOPIC_ID' => $r['topic_id'], + 'FORUM_ID' => $r['forum_id'], + 'TITLE' => $r['title'], + 'NAME' => $r['name'], + 'POSTER' => $poster, + ) + ); + + $this->email->subject = $ibforums->lang['tt_subject']; + $this->email->to = $r['email']; + + $this->email->send_mail(); + + } + + $trids[] = $r['trid']; + } + } + return TRUE; + } + + + + /*****************************************************/ + // Forum tracker + // ------------------ + // Checks and sends out the new topic notification if + // needed + /*****************************************************/ + + function forum_tracker($fid="", $this_tid="", $title="", $forum_name="") + { + global $ibforums, $DB, $std; + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + //------------------------- + + if ($this_tid == "") + { + return TRUE; + } + + if ($fid == "") + { + return TRUE; + } + + // Work out the time stamp needed to "guess" if the user is still active on the board + // We will base this guess on a period of non activity of time_now - 30 minutes. + + $time_limit = time() - (30*60); + + // There is the chance that an admin makes a forum, leaves it. Some one subscribes to the forum + // and then the admin decides to make it hidden from the public via member groups. If this happened, + // this forum will still send all notifications - this is not desirable, so we check for permissions + // in the SQL query - just in case. + + $allowed_groups = ""; + + if ($this->forum['read_perms'] != '*') + { + if (strlen($this->forum['read_perms'] > 0)) + { + $allowed_groups = " AND m.mgroup IN (0,".$this->forum['read_perms'].") "; + } + } + + // Get the email addy's, topic ids and email_full stuff - oh yeah. + // We only return rows that have a member last_activity of greater than the post itself + + $DB->query("SELECT tr.frid, m.name, m.email, m.id, m.language, m.last_activity + FROM ibf_forum_tracker tr,ibf_members m + WHERE tr.forum_id='$fid' + AND tr.member_id=m.id + AND m.id <> '{$ibforums->member['id']}' + $allowed_groups + AND m.last_activity < '$time_limit'"); + + if ( $DB->get_num_rows() ) + { + while ( $r = $DB->fetch_row() ) + { + $r['language'] = $r['language'] ? $r['language'] : 'en'; + + $this->email->get_template("subs_new_topic", $r['language']); + + $this->email->build_message( array( + 'TOPIC_ID' => $this_tid, + 'FORUM_ID' => $fid, + 'TITLE' => $title, + 'NAME' => $r['name'], + 'POSTER' => $ibforums->member['name'], + 'FORUM' => $forum_name, + ) + ); + + $this->email->subject = $ibforums->lang['ft_subject']; + $this->email->to = $r['email']; + + $this->email->send_mail(); + } + } + return TRUE; + } + + + /*****************************************************/ + // compile post + // ------------------ + // Compiles all the incoming information into an array + // which is returned to the accessor + /*****************************************************/ + + function compile_post() + { + global $ibforums, $std, $REQUEST_METHOD, $HTTP_POST_VARS; + + $ibforums->vars['max_post_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; + + // sort out some of the form data, check for posting length, etc. + // THIS MUST BE CALLED BEFORE CHECKING ATTACHMENTS + + $ibforums->input['enablesig'] = $ibforums->input['enablesig'] == 'yes' ? 1 : 0; + $ibforums->input['enableemo'] = $ibforums->input['enableemo'] == 'yes' ? 1 : 0; + + // Do we have a valid post? + + if (strlen( trim($HTTP_POST_VARS['Post']) ) < 1) { + $std->Error( array( LEVEL => 1, MSG => 'no_post') ); + } + + if (strlen( $HTTP_POST_VARS['Post'] ) > ($ibforums->vars['max_post_length']*1024)) { + $std->Error( array( LEVEL => 1, MSG => 'post_too_long') ); + } + + $post = array( + 'author_id' => $ibforums->member['id'] ? $ibforums->member['id'] : 0, + 'use_sig' => $ibforums->input['enablesig'], + 'use_emo' => $ibforums->input['enableemo'], + 'ip_address' => $ibforums->input['IP_ADDRESS'], + 'post_date' => time(), + 'icon_id' => $ibforums->input['iconid'], + 'post' => $this->parser->convert( array( TEXT => $ibforums->input['Post'], + SMILIES => $ibforums->input['enableemo'], + CODE => $this->forum['use_ibc'], + HTML => $this->forum['use_html'] + ) + ), + 'author_name' => $ibforums->member['id'] ? $ibforums->member['name'] : $ibforums->input['UserName'], + 'forum_id' => $this->forum['id'], + 'topic_id' => "", + 'queued' => $this->obj['moderate'], + 'attach_id' => "", + 'attach_hits' => "", + 'attach_type' => "", + ); + + // If we had any errors, parse them back to this class + // so we can track them later. + + $this->obj['post_errors'] = $this->parser->error; + + return $post; + } + + /*****************************************************/ + // process upload + // ------------------ + // checks for an entry in the upload field, and uploads + // the file if it meets our criteria. This also inserts + // a new row into the attachments database if successful + /*****************************************************/ + + function process_upload() { + + global $ibforums, $std, $HTTP_POST_FILES, $DB, $FILE_UPLOAD; + + //------------------------------------------------- + // Set up some variables to stop carpals developing + //------------------------------------------------- + + $FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name']; + $FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size']; + $FILE_TYPE = $HTTP_POST_FILES['FILE_UPLOAD']['type']; + + // Naughty Opera adds the filename on the end of the + // mime type - we don't want this. + + $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); + + $attach_data = array( 'attach_id' => "", + 'attach_hits' => "", + 'attach_type' => "", + 'attach_file' => "", + ); + + //------------------------------------------------- + // Return if we don't have a file to upload + //------------------------------------------------- + + // Naughty Mozilla likes to use "none" to indicate an empty upload field. + // I love universal languages that aren't universal. + + if ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "" or !$HTTP_POST_FILES['FILE_UPLOAD']['name'] or ($HTTP_POST_FILES['FILE_UPLOAD']['name'] == "none") ) return $attach_data; + + //------------------------------------------------- + // Return empty handed if we don't have permission to use + // uploads + //------------------------------------------------- + + if ( ($this->can_upload != 1) and ($ibforums->member['g_attach_max'] < 1) ) return $attach_data; + + //------------------------------------------------- + // Load our mime types config file. + //------------------------------------------------- + + require "./conf_mime_types.php"; + + //------------------------------------------------- + // Are we allowing this type of file? + //------------------------------------------------- + + if ($mime_types[ $FILE_TYPE ][0] != 1) + { + $this->obj['post_errors'] = 'invalid_mime_type'; + return $attach_data; + } + + //------------------------------------------------- + // Check the file size + //------------------------------------------------- + + if ($FILE_SIZE > ($ibforums->member['g_attach_max']*1024)) + { + $std->Error( array( LEVEL => 1, MSG => 'upload_to_big') ); + } + + //------------------------------------------------- + // Make the uploaded file safe + //------------------------------------------------- + + $FILE_NAME = preg_replace( "/[^\w\.]/", "_", $FILE_NAME ); + + $real_file_name = "post-".$this->forum['id']."-".time(); // Note the lack of extension! + + if (preg_match( "/\.(cgi|pl|js|asp|php|html|htm|jsp|jar)/", $FILE_NAME )) + { + $FILE_TYPE = 'text/plain'; + } + + //------------------------------------------------- + // Add on the extension... + //------------------------------------------------- + + $ext = '.ibf'; + + switch($FILE_TYPE) + { + case 'image/gif': + $ext = '.gif'; + break; + case 'image/jpeg': + $ext = '.jpg'; + break; + case 'image/pjpeg': + $ext = '.jpg'; + break; + case 'image/x-png': + $ext = '.png'; + break; + default: + $ext = '.ibf'; + break; + } + + $real_file_name .= $ext; + + //------------------------------------------------- + // If we are previewing the post, we don't want to + // add the attachment to the database, so we return + // the array with the filename. We would have returned + // earlier if there was an error + //------------------------------------------------- + + if ($this->obj['preview_post']) + { + return array( 'FILE_NAME' => $FILE_NAME ); + } + + //------------------------------------------------- + // Copy the upload to the uploads directory + //------------------------------------------------- + + if (! @move_uploaded_file( $HTTP_POST_FILES['FILE_UPLOAD']['tmp_name'], $ibforums->vars['upload_dir']."/".$real_file_name) ) + { + $this->obj['post_errors'] = 'upload_failed'; + return $attach_data; + } + else + { + @chmod( $ibforums->vars['upload_dir']."/".$real_file_name, 0777 ); + } + + //------------------------------------------------- + // set the array, and enter the info into the DB + // We don't have an extension on the file in the + // hope that it make it more difficult to execute + // a script on our server. + //------------------------------------------------- + + $attach_data['attach_id'] = $real_file_name; + $attach_data['attach_hits'] = 0; + $attach_data['attach_type'] = $FILE_TYPE; + $attach_data['attach_file'] = $FILE_NAME; + + return $attach_data; + } + + + + /*****************************************************/ + // check_upload_ability + // ------------------ + // checks to make sure the requesting browser can accept + // file uploads, also checks if the member group can + // accept uploads and returns accordingly. + /*****************************************************/ + + function check_upload_ability() { + global $ibforums; + + if ( ($this->can_upload == 1) and $ibforums->member['g_attach_max'] > 0) + { + $this->obj['can_upload'] = 1; + $this->obj['form_extra'] = " enctype='multipart/form-data'"; + $this->obj['hidden_field'] = ""; + } + + } + + /*****************************************************/ + // HTML: mod_options. + // ------------------ + // Returns the HTML for the mod options drop down box + /*****************************************************/ + + function mod_options($is_reply=0) { + global $ibforums, $DB; + + $can_close = 0; + $can_pin = 0; + $can_move = 0; + + $html = "". + "". + "". + "". + $this->obj['hidden_field']; + + // Any other tags to add? + + if (isset($additional_tags)) { + foreach($additional_tags as $k => $v) { + $form .= "\n"; + } + } + + return $form; + } + + /*****************************************************/ + // HTML: name fields. + // ------------------ + // Returns the HTML for either text inputs or membername + // depending if the member is a guest. + /*****************************************************/ + + function html_name_field() { + global $ibforums; + + return $ibforums->member['id'] ? $this->html->nameField_reg() : $this->html->nameField_unreg( $ibforums->input[UserName] ); + } + + /*****************************************************/ + // HTML: Post body. + // ------------------ + // Returns the HTML for post area, code buttons and + // post icons + /*****************************************************/ + + function html_post_body($raw_post="") { + global $ibforums; + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; + + return $this->html->postbox_buttons($raw_post); + + } + + /*****************************************************/ + // HTML: Post Icons + // ------------------ + // Returns the HTML for post area, code buttons and + // post icons + /*****************************************************/ + + function html_post_icons($post_icon="") { + global $ibforums; + + if ($ibforums->input['iconid']) + { + $post_icon = $ibforums->input['iconid']; + } + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] * 1024; + + $html = $this->html->PostIcons(); + + if ($post_icon) { + $html = preg_replace( "/name=[\"']iconid[\"']\s*value=[\"']$post_icon\s?[\"']/", "name='iconid' value='$post_icon' checked", $html ); + $html = preg_replace( "/name=[\"']iconid[\"']\s*value=[\"']0[\"']\s*checked/i" , "name='iconid' value='0'", $html ); + } + return $html; + } + + /*****************************************************/ + // HTML: add smilie box. + // ------------------ + // Inserts the clickable smilies box + /*****************************************************/ + + function html_add_smilie_box() { + global $ibforums, $DB; + + $show_table = 0; + $count = 0; + $smilies = "\n"; + + // Get the smilies from the DB + + $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); + + while ($elmo = $DB->fetch_row() ) { + + $show_table++; + $count++; + + $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; + + if ($count == $ibforums->vars['emo_per_row']) { + $smilies .= "\n\n"; + $count = 0; + } + } + + if ($count != $ibforums->vars['emo_per_row']) { + for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { + $smilies .= " \n"; + } + $smilies .= ""; + } + + $table = $this->html->smilie_table(); + + if ($show_table != 0) { + $table = preg_replace( "//", $smilies, $table ); + $this->output = preg_replace( "//", $table, $this->output ); + } + + } + + /*****************************************************/ + // HTML: topic summary. + // ------------------ + // displays the last 10 replies to the topic we're + // replying in. + /*****************************************************/ + + function html_topic_summary($topic_id) { + + global $ibforums, $std, $DB; + + if (! $topic_id ) return; + + $cached_members = array(); + + $this->output .= $this->html->TopicSummary_top(); + + //-------------------------------------------------------------- + // Get the posts + // This section will probably change at some point + //-------------------------------------------------------------- + + $post_query = $DB->query("SELECT post, pid, post_date, author_id, author_name FROM ibf_posts WHERE topic_id='$topic_id' and queued <> 1 ORDER BY pid DESC LIMIT 0,10"); + + while ( $row = $DB->fetch_row($post_query) ) + { + + $row['author'] = $row['author_name']; + + $row['date'] = $std->get_date( $row['post_date'], 'LONG' ); + + $this->output .= $this->html->TopicSummary_body( $row ); + } + + $this->output .= $this->html->TopicSummary_bottom(); + + } + + /*****************************************************/ + // Moderators log + // ------------------ + // Simply adds the last action to the mod logs + /*****************************************************/ + + function moderate_log($title = 'unknown', $topic_title) { + global $std, $ibforums, $DB, $HTTP_REFERER, $QUERY_STRING; + + $db_string = $std->compile_db_string( array ( + 'forum_id' => $ibforums->input['f'], + 'topic_id' => $ibforums->input['t'], + 'post_id' => $ibforums->input['p'], + 'member_id' => $ibforums->member['id'], + 'member_name' => $ibforums->member['name'], + 'ip_address' => $ibforums->input['IP_ADDRESS'], + 'http_referer'=> $HTTP_REFERER, + 'ctime' => time(), + 'topic_title' => $topic_title, + 'action' => $title, + 'query_string'=> $QUERY_STRING, + ) + ); + + $DB->query("INSERT INTO ibf_moderator_logs (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + } + +} + ?> \ No newline at end of file diff --git a/upload/sources/Profile.php b/upload/sources/Profile.php index abc33f8b..d707b6f4 100644 --- a/upload/sources/Profile.php +++ b/upload/sources/Profile.php @@ -1,301 +1,346 @@ - User Profile functions -| > Module written by Matt Mecham -| > Date started: 28th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Profile; - -class Profile { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $html = ""; - var $parser; - - var $member = array(); - var $m_group = array(); - - var $jump_html = ""; - var $parser = ""; - - var $links = array(); - - var $bio = ""; - var $notes = ""; - var $size = "m"; - - var $lib; - - function Profile() { - global $ibforums, $DB, $std, $print; - - require "./sources/lib/post_parser.php"; - - $this->parser = new post_parser(); - - //-------------------------------------------- - // Make sure our code number is numerical only - //-------------------------------------------- - - //$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input['CODE']); - - if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00; - - //-------------------------------------------- - // Require the HTML and language modules - //-------------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_profile' , $ibforums->lang_id ); - - require "./Skin/".$ibforums->skin_id."/skin_profile.php"; - $this->html = new skin_profile; - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}"; - - //-------------------------------------------- - // Check viewing permissions, etc - //-------------------------------------------- - - $this->member = $ibforums->member; - $this->m_group = $ibforums->member; - - - //-------------------------------------------- - // What to do? - //-------------------------------------------- - - - switch($ibforums->input['CODE']) { - case '03': - $this->view_profile(); - break; - - //------------------------------ - default: - $this->view_profile(); - break; - } - - // If we have any HTML to print, do so... - - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, NAV => $this->nav ) ); - - } - - function view_profile() { - global $ibforums, $DB, $std, $print; - - $info = array(); - - if ($ibforums->member['g_mem_info'] != 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); - } - - //-------------------------------------------- - // Check input.. - //-------------------------------------------- - - $id = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['MID'] ); - - if ( empty($id) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); - } - - //-------------------------------------------- - // Prepare Query... - //-------------------------------------------- - - $DB->query("SELECT m.*, g.g_id, g.g_title as group_title FROM ibf_members m, ibf_groups g WHERE m.id='$id' and m.mgroup=g.g_id"); - $member = $DB->fetch_row(); - - if (empty($member['id'])) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); - } - - // Play it safe - - $member['password'] = ""; - - //-------------------------------------------- - // Find the most posted in forum that the viewing - // member has access to by this members profile - //-------------------------------------------- - - $DB->query("SELECT id, read_perms FROM ibf_forums"); - - $forum_ids = array('0'); - - while ( $r = $DB->fetch_row() ) - { - if ($r['read_perms'] == '*') - { - $forum_ids[] = $r['id']; - } - else if ( preg_match( "/(^|,)".$this->member['mgroup']."(,|$)/", $r['read_perms']) ) - { - $forum_ids[] = $r['id']; - } - } - - $forum_id_str = implode( ",", $forum_ids ); - - $percent = 0; - - $DB->query("SELECT DISTINCT(p.forum_id), f.name, COUNT(p.author_id) as f_posts FROM ibf_posts p, ibf_forums f ". - "WHERE p.forum_id IN ($forum_id_str) AND p.author_id='".$member['id']."' AND p.forum_id=f.id GROUP BY p.forum_id ORDER BY f_posts DESC"); - - $favourite = $DB->fetch_row(); - - $DB->query("SELECT COUNT(pid) as total_posts FROM ibf_posts WHERE author_id='".$member['id']."'"); - - $total_posts = $DB->fetch_row(); - - $DB->query("SELECT TOTAL_TOPICS, TOTAL_REPLIES FROM ibf_stats"); - - $stats = $DB->fetch_row(); - - $board_posts = $stats['TOTAL_TOPICS'] + $stats['TOTAL_REPLIES']; - - if ($total_posts['total_posts'] > 0) - { - $percent = round( $favourite['f_posts'] / $total_posts['total_posts'] * 100 ); - } - - if ($member['posts']) - { - $info['posts_day'] = round( $member['posts'] / (((time() - $member['joined']) / 86400)), 1); - $info['total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) ); - } - - if ($info['posts_day'] > $member['posts']) - { - $info['posts_day'] = $member['posts']; - } - - $info['posts'] = $member['posts'] ? $member['posts'] : 0; - $info['name'] = $member['name']; - $info['mid'] = $member['id']; - $info['fav_forum'] = $favourite['name']; - $info['fav_id'] = $favourite['forum_id']; - $info['fav_posts'] = $favourite['f_posts']; - $info['percent'] = $percent; - $info['group_title'] = $member['group_title']; - $info['board_posts'] = $board_posts; - $info['joined'] = $std->get_date( $member['joined'], 'LONG' ); - - $info['member_title'] = $member['title'] ? $member['title'] : $ibforums->lang['no_info']; - - $info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $ibforums->lang['no_info']; - $info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $ibforums->lang['no_info']; - $info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $ibforums->lang['no_info']; - $info['location'] = $member['location'] ? $member['location'] : $ibforums->lang['no_info']; - $info['interests'] = $member['interests'] ? $member['interests'] : $ibforums->lang['no_info']; - $info['msn_name'] = $member['msnname'] ? $member['msnname'] : $ibforums->lang['no_info']; - - $ibforums->vars['time_adjust'] = $ibforums->vars['time_adjust'] == "" ? 0 : $ibforums->vars['time_adjust']; - - if ($member['dst_in_use'] == 1) - { - $member['time_offset'] += 1; - } - - $info['local_time'] = $member['time_offset'] != "" ? gmdate( "h:i A", time() + ($member['time_offset']*3600) + ($ibforums->vars['time_adjust'] * 60) ) : $ibforums->lang['no_info']; - - $info['avatar'] = $std->get_avatar( $member['avatar'] , 1, $member['avatar_size'] ); - - $info['signature'] = $member['signature']; - - if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) ) { - $info['homepage'] = "{$member['website']}"; - } - else - { - $info['homepage'] = $ibforums->lang['no_info']; - } - - - if ($member['bday_month']) - { - $info['birthday'] = $member['bday_day']." ".$ibforums->lang[ 'M_'.$member['bday_month'] ]." ".$member['bday_year']; - } - else - { - $info['birthday'] = $ibforums->lang['no_info']; - } - - - if (!$member['hide_email']) { - $info['email'] = "{$ibforums->lang['click_here']}"; - } - else - { - $info['email'] = $ibforums->lang['private']; - } - - $info['base_url'] = $this->base_url; - - $this->output .= $this->html->show_profile( $info ); - - // Is this our profile? - - if ($member['id'] == $this->member['id']) - { - $this->output = preg_replace( "//e", "\$this->html->user_edit(\$info)", $this->output ); - } - - // Can mods edit this profile? - - if ($ibforums->member['id']) - { - if ($ibforums->member['g_is_supmod'] == 1) - { - $pass = 1; - } - else - { - $DB->query("SELECT * FROM ibf_moderators WHERE edit_user=1 AND member_id='".$ibforums->member['id']."'"); - if ( $this->moderator = $DB->fetch_row() ) - { - $pass = 1; - } - } - } - - - - $this->page_title = $ibforums->lang['page_title']; - $this->nav = array( $ibforums->lang['page_title'] ); - - } - - - -} - + User Profile functions +| > Module written by Matt Mecham +| > Date started: 28th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Profile; + +class Profile { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $html = ""; + var $parser; + + var $member = array(); + var $m_group = array(); + + var $jump_html = ""; + var $parser = ""; + + var $links = array(); + + var $bio = ""; + var $notes = ""; + var $size = "m"; + + var $lib; + + function Profile() { + global $ibforums, $DB, $std, $print; + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + //-------------------------------------------- + // Make sure our code number is numerical only + //-------------------------------------------- + + //$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input['CODE']); + + if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00; + + //-------------------------------------------- + // Require the HTML and language modules + //-------------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_profile' , $ibforums->lang_id ); + + $this->html = $std->load_template('skin_profile'); + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}"; + + //-------------------------------------------- + // Check viewing permissions, etc + //-------------------------------------------- + + $this->member = $ibforums->member; + $this->m_group = $ibforums->member; + + + //-------------------------------------------- + // What to do? + //-------------------------------------------- + + + switch($ibforums->input['CODE']) { + case '03': + $this->view_profile(); + break; + + //------------------------------ + default: + $this->view_profile(); + break; + } + + // If we have any HTML to print, do so... + + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, NAV => $this->nav ) ); + + } + + function view_profile() { + global $ibforums, $DB, $std, $print; + + $info = array(); + + if ($ibforums->member['g_mem_info'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); + } + + //-------------------------------------------- + // Check input.. + //-------------------------------------------- + + $id = preg_replace( "/^(\d+)$/", "\\1", $ibforums->input['MID'] ); + + if ( empty($id) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); + } + + //-------------------------------------------- + // Prepare Query... + //-------------------------------------------- + + $DB->query("SELECT m.*, g.g_id, g.g_title as group_title FROM ibf_members m, ibf_groups g WHERE m.id='$id' and m.mgroup=g.g_id"); + $member = $DB->fetch_row(); + + if (empty($member['id'])) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); + } + + // Play it safe + + $member['password'] = ""; + + //-------------------------------------------- + // Find the most posted in forum that the viewing + // member has access to by this members profile + //-------------------------------------------- + + $DB->query("SELECT id, read_perms FROM ibf_forums"); + + $forum_ids = array('0'); + + while ( $r = $DB->fetch_row() ) + { + if ($r['read_perms'] == '*') + { + $forum_ids[] = $r['id']; + } + else if ( preg_match( "/(^|,)".$this->member['mgroup']."(,|$)/", $r['read_perms']) ) + { + $forum_ids[] = $r['id']; + } + } + + $forum_id_str = implode( ",", $forum_ids ); + + $percent = 0; + + $DB->query("SELECT DISTINCT(p.forum_id), f.name, COUNT(p.author_id) as f_posts FROM ibf_posts p, ibf_forums f ". + "WHERE p.forum_id IN ($forum_id_str) AND p.author_id='".$member['id']."' AND p.forum_id=f.id GROUP BY p.forum_id ORDER BY f_posts DESC"); + + $favourite = $DB->fetch_row(); + + $DB->query("SELECT COUNT(pid) as total_posts FROM ibf_posts WHERE author_id='".$member['id']."'"); + + $total_posts = $DB->fetch_row(); + + $DB->query("SELECT TOTAL_TOPICS, TOTAL_REPLIES FROM ibf_stats"); + + $stats = $DB->fetch_row(); + + $board_posts = $stats['TOTAL_TOPICS'] + $stats['TOTAL_REPLIES']; + + if ($total_posts['total_posts'] > 0) + { + $percent = round( $favourite['f_posts'] / $total_posts['total_posts'] * 100 ); + } + + if ($member['posts']) + { + $info['posts_day'] = round( $member['posts'] / (((time() - $member['joined']) / 86400)), 1); + $info['total_pct'] = sprintf( '%.2f', ( $member['posts'] / $board_posts * 100 ) ); + } + + if ($info['posts_day'] > $member['posts']) + { + $info['posts_day'] = $member['posts']; + } + + $info['posts'] = $member['posts'] ? $member['posts'] : 0; + $info['name'] = $member['name']; + $info['mid'] = $member['id']; + $info['fav_forum'] = $favourite['name']; + $info['fav_id'] = $favourite['forum_id']; + $info['fav_posts'] = $favourite['f_posts']; + $info['percent'] = $percent; + $info['group_title'] = $member['group_title']; + $info['board_posts'] = $board_posts; + $info['joined'] = $std->get_date( $member['joined'], 'LONG' ); + + $info['member_title'] = $member['title'] ? $member['title'] : $ibforums->lang['no_info']; + + $info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $ibforums->lang['no_info']; + $info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $ibforums->lang['no_info']; + $info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $ibforums->lang['no_info']; + $info['location'] = $member['location'] ? $member['location'] : $ibforums->lang['no_info']; + $info['interests'] = $member['interests'] ? $member['interests'] : $ibforums->lang['no_info']; + $info['msn_name'] = $member['msnname'] ? $member['msnname'] : $ibforums->lang['no_info']; + + $ibforums->vars['time_adjust'] = $ibforums->vars['time_adjust'] == "" ? 0 : $ibforums->vars['time_adjust']; + + if ($member['dst_in_use'] == 1) + { + $member['time_offset'] += 1; + } + + $info['local_time'] = $member['time_offset'] != "" ? gmdate( "h:i A", time() + ($member['time_offset']*3600) + ($ibforums->vars['time_adjust'] * 60) ) : $ibforums->lang['no_info']; + + $info['avatar'] = $std->get_avatar( $member['avatar'] , 1, $member['avatar_size'] ); + + $info['signature'] = $member['signature']; + + if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) ) { + $info['homepage'] = "{$member['website']}"; + } + else + { + $info['homepage'] = $ibforums->lang['no_info']; + } + + + if ($member['bday_month']) + { + $info['birthday'] = $member['bday_day']." ".$ibforums->lang[ 'M_'.$member['bday_month'] ]." ".$member['bday_year']; + } + else + { + $info['birthday'] = $ibforums->lang['no_info']; + } + + + if (!$member['hide_email']) { + $info['email'] = "{$ibforums->lang['click_here']}"; + } + else + { + $info['email'] = $ibforums->lang['private']; + } + + $info['base_url'] = $this->base_url; + + $this->output .= $this->html->show_profile( $info ); + + // Is this our profile? + + if ($member['id'] == $this->member['id']) + { + $this->output = preg_replace( "//e", "\$this->html->user_edit(\$info)", $this->output ); + } + + // Can mods see the hidden parts of this profile? + + $query_extra = 'WHERE fedit=1 AND fhide <> 1'; + $custom_out = ""; + $field_data = array(); + + if ($ibforums->member['id']) + { + if ($ibforums->member['g_is_supmod'] == 1) + { + $query_extra = ""; + } + else if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) + { + $query_extra = ""; + } + } + + $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$member['id']."'"); + + while ( $content = $DB->fetch_row() ) + { + foreach($content as $k => $v) + { + if ( preg_match( "/^field_(\d+)$/", $k, $match) ) + { + $field_data[ $match[1] ] = $v; + } + } + } + + $DB->query("SELECT * from ibf_pfields_data $query_extra ORDER BY forder"); + + while( $row = $DB->fetch_row() ) + { + if ($row['ftype'] == 'drop') + { + $carray = explode( '|', trim($row['fcontent']) ); + + foreach( $carray as $entry ) + { + $value = explode( '=', $entry ); + + $ov = trim($value[0]); + $td = trim($value[1]); + + if ($field_data[ $row['fid'] ] == $ov) + { + $field_data[ $row['fid'] ] = $td; + } + } + } + else + { + $field_data[ $row['fid'] ] = ($field_data[ $row['fid'] ] == "") ? $ibforums->lang['no_info'] : $field_data[ $row['fid'] ]; + } + + $custom_out .= $this->html->custom_field($row['ftitle'], $field_data[ $row['fid'] ] ); + } + + if ($custom_out != "") + { + $this->output = str_replace( "", $custom_out, $this->output ); + } + + + $this->page_title = $ibforums->lang['page_title']; + $this->nav = array( $ibforums->lang['page_title'] ); + + } + + + +} + ?> \ No newline at end of file diff --git a/upload/sources/Register.php b/upload/sources/Register.php index e6e4830b..e97dbb97 100644 --- a/upload/sources/Register.php +++ b/upload/sources/Register.php @@ -1,710 +1,1062 @@ - Registration functions -| > Module written by Matt Mecham -| > Date started: 16th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -*/ - - -$idx = new Register; - -class Register { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $html = ""; - var $email = ""; - - function Register() { - global $ibforums, $DB, $std, $print; - - //-------------------------------------------- - // Make sure our code number is numerical only - //-------------------------------------------- - - //$ibforums->input['CODE'] = preg_replace("/^([0-9]+)$/", "$1", $ibforums->input['CODE']); - - if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = 00; - - //-------------------------------------------- - // Require the HTML and language modules - //-------------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_register', $ibforums->lang_id ); - - require "./Skin/".$ibforums->skin_id."/skin_register.php"; - $this->html = new skin_register(); - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}"; - - //-------------------------------------------- - // Get the emailer module - //-------------------------------------------- - - require "./sources/lib/emailer.php"; - - $this->email = new emailer(); - - //-------------------------------------------- - // What to do? - //-------------------------------------------- - - switch($ibforums->input['CODE']) { - case '00': - $this->show_reg_form(); - break; - - case '02': - $this->create_account(); - break; - - case '03': - $this->validate_user(); - break; - - case '05': - $this->show_manual_form(); - break; - - case '06': - $this->show_manual_form('lostpass'); - break; - - case '07': - $this->show_manual_form('newemail'); - break; - - case '10': - $this->lost_password_start(); - break; - case '11': - $this->lost_password_end(); - break; - - default: - $this->show_reg_form(); - break; - } - - // If we have any HTML to print, do so... - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - } - - /*****************************************************/ - // lost_password_start - // ------------------ - // Simply shows the lostpassword form - // What do you want? Blood? - /*****************************************************/ - - function lost_password_start() - { - global $ibforums, $DB, $std; - - $this->page_title = $ibforums->lang['lost_pass_form']; - - $this->nav = array( $ibforums->lang['lost_pass_form'] ); - - $this->output .= $this->html->lost_pass_form(); - } - - - - - function lost_password_end() - { - global $ibforums, $DB, $std, $HTTP_POST_VARS, $print; - - if ($HTTP_POST_VARS['member_name'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); - } - - //------------------------------------------------------------ - // Check for input and it's in a valid format. - //------------------------------------------------------------ - - $member_name = trim(strtolower($ibforums->input['member_name'])); - - if ($member_name == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); - } - - //------------------------------------------------------------ - // Attempt to get the user details from the DB - //------------------------------------------------------------ - - $DB->query("SELECT name, id, email, mgroup, validate_key FROM ibf_members WHERE LOWER(name)='$member_name'"); - - if ( !$DB->get_num_rows() ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) ); - } - else - { - $member = $DB->fetch_row(); - - //------------------------------------------------------------ - // Is there a validation key? If so, we'd better not touch it - //------------------------------------------------------------ - - if ($member['mgroup'] == $ibforums->vars['auth_group']) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'val_key_present' ) ); - } - - if ($member['id'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) ); - } - - $new_pass = $std->make_password(); - $validate_key = $std->make_password(); - $md5_pass = md5($new_pass); - - //------------------------------------------------------------ - // Update the DB for this member. - //------------------------------------------------------------ - - $DB->query("UPDATE ibf_members SET new_pass='$md5_pass', validate_key='$validate_key' WHERE id='".$member['id']."'"); - - //------------------------------------------------------------ - // Send out the email. - //------------------------------------------------------------ - - $this->email->get_template("lost_pass"); - - $this->email->build_message( array( - 'NAME' => $member['name'], - 'PASSWORD' => $new_pass, - 'MAN_LINK' => $this->base_url_nosess."?act=Reg&CODE=06", - 'EMAIL' => $member['email'], - 'ID' => $member['id'], - 'CODE' => $validate_key, - ) - ); - - $this->email->subject = $ibforums->lang['lp_subject'].' '.$ibforums->vars['BOARDNAME']; - $this->email->to = $member['email']; - - $this->email->send_mail(); - - $std->my_setcookie( 'pass_hash' , '-1', 0 ); - - $print->redirect_screen( $ibforums->lang['lp_redirect'], 'act=Reg&CODE=06' ); - } - - } - - /*****************************************************/ - // show_reg_form - // ------------------ - // Simply shows the registration form, no - really! Thats - // all it does. It doesn't make the tea or anything. - // Just the registration form, no more - no less. - // Unless your server went down, then it's just useless. - /*****************************************************/ - - function show_reg_form() { - global $ibforums, $DB, $std; - - if ($ibforums->vars['no_reg'] == 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) ); - } - - if ($ibforums->vars['reg_auth_type']) - { - $ibforums->lang['std_text'] .= "
    " . $ibforums->lang['email_validate_text']; - } - - $this->page_title = $ibforums->lang['registration_form']; - $this->nav = array( $ibforums->lang['registration_form'] ); - - $this->output .= $this->html->ShowForm( array( 'TEXT' => $ibforums->lang['std_text'], 'RULES' => $ibforums->lang['click_wrap'] ) ); - - } - - /*****************************************************/ - // create_account - // ------------------ - // Now this is a really good subroutine. It adds the member - // to the members table in the database. Yes, really fancy - // this one. It also finds the time to see if we need to - // check any email verification type malarky before we - // can use this brand new account. It's like buying a new - // car and getting it towed home and being told the keys - // will be posted later. Although you can't polish this - // routine while you're waiting. - /*****************************************************/ - - function create_account() { - global $ibforums, $std, $DB, $print; - - if ($ibforums->vars['no_reg'] == 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) ); - } - - // Trim off the username and password - - $in_username = trim($ibforums->input['UserName']); - $in_password = trim($ibforums->input['PassWord']); - $in_email = strtolower( trim($ibforums->input['EmailAddress']) ); - - $ibforums->input['EmailAddress_two'] = strtolower( trim($ibforums->input['EmailAddress_two']) ); - - if ($ibforums->input['EmailAddress_two'] != $in_email) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'email_addy_mismatch' ) ); - } - - //+-------------------------------------------- - //| Check for errors in the input. - //+-------------------------------------------- - - if (empty($in_username)) $std->Error( array( LEVEL => 1, MSG => 'no_username' ) ); - if (strlen($in_username) < 3) $std->Error( array( LEVEL => 1, MSG => 'username_short' ) ); - if (strlen($in_username) > 32) $std->Error( array( LEVEL => 1, MSG => 'username_long' ) ); - - if (empty($in_password)) $std->Error( array( LEVEL => 1, MSG => 'pass_blank' ) ); - if (strlen($in_password) < 3) $std->Error( array( LEVEL => 1, MSG => 'pass_too_short' ) ); - if (strlen($in_password) > 32) $std->Error( array( LEVEL => 1, MSG => 'pass_too_long' ) ); - if ($ibforums->input['PassWord_Check'] != $in_password) $std->Error( array( LEVEL => 1, MSG => 'pass_no_match' ) ); - - if (strlen($in_email) < 6) $std->Error( array( LEVEL => 1, MSG => 'invalid_email' ) ); - - //+-------------------------------------------- - //| Check the email address - //+-------------------------------------------- - - $in_email = $std->clean_email($in_email); - - if (! $in_email ) - { - $std->Error( array( LEVEL => 1, MSG => 'invalid_email' ) ); - } - - //+-------------------------------------------- - //| Is this name already taken? - //+-------------------------------------------- - - $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".strtolower($in_username)."'"); - $name_check = $DB->fetch_row(); - - if ($name_check['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) ); - } - - if (strtolower($in_username) == 'guest') - { - $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) ); - } - - //+-------------------------------------------- - //| Is this email addy taken? - //+-------------------------------------------- - - if (! $ibforums->vars['allow_dup_email'] ) - { - $DB->query("SELECT id FROM ibf_members WHERE email='".$in_email."'"); - $email_check = $DB->fetch_row(); - if ($email_check['id']) - { - $std->Error( array( LEVEL => 1, MSG => 'email_exists' ) ); - } - } - - //+-------------------------------------------- - //| Are they in the reserved names list? - //+-------------------------------------------- - - if ($ibforums->vars['ban_names']) - { - $names = explode( "|" , $ibforums->vars['ban_names'] ); - foreach ($names as $n) - { - if (preg_match( "/$n/i", $in_username )) - { - $std->Error( array( LEVEL => 1, MSG => 'user_exists' ) ); - break; - } - } - } - - //+-------------------------------------------- - //| Are they banned? - //+-------------------------------------------- - - if ($ibforums->vars['ban_ip']) - { - $ips = explode( "|", $ibforums->vars['ban_ip'] ); - foreach ($ips as $ip) - { - $ip = preg_replace( "/\*/", '.*' , $ip ); - if (preg_match( "/$ip/", $ibforums->input['IP_ADDRESS'] )) - { - $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); - } - } - } - - if ($ibforums->vars['ban_email']) - { - $ips = explode( "|", $ibforums->vars['ban_email'] ); - foreach ($ips as $ip) - { - $ip = preg_replace( "/\*/", '.*' , $ip ); - if (preg_match( "/$ip/", $in_email )) - { - $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); - } - } - } - - - //+-------------------------------------------- - //| Build up the hashes - //+-------------------------------------------- - - $mem_group = $ibforums->vars['member_group']; - - //+-------------------------------------------- - //| Are we asking the member or admin to preview? - //+-------------------------------------------- - - if ($ibforums->vars['reg_auth_type']) - { - $mem_group = $ibforums->vars['auth_group']; - } - - //+-------------------------------------------- - //| Find the highest member id, and increment it - //| auto_increment not used for guest id 0 val. - //+-------------------------------------------- - - $DB->query("SELECT MAX(id) as new_id FROM ibf_members"); - $r = $DB->fetch_row(); - - $member_id = $r['new_id'] + 1; - - $member = array( - 'id' => $member_id, - 'name' => $in_username, - 'password' => $in_password, - 'email' => $in_email, - 'mgroup' => $mem_group, - 'posts' => 0, - 'avatar' => 'noavatar', - 'joined' => time(), - 'ip_address' => $ibforums->input['IP_ADDRESS'], - 'time_offset' => $ibforums->vars['time_offset'], - 'view_sigs' => 1, - 'email_pm' => 1, - 'view_img' => 1, - 'view_avs' => 1, - 'allow_post' => 1, - 'view_pop' => 1, - 'vdirs' => "in:Inbox|sent:Sent Items", - 'msg_total' => 0, - 'new_msg' => 0, - ); - - - - //+-------------------------------------------- - //| Insert into the DB - //+-------------------------------------------- - - $member['password'] = md5( $member['password'] ); - - $db_string = $std->compile_db_string( $member ); - - $DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); - - unset($db_string); - - $validate_key = $std->make_password(); - $time = time(); - - - if ( ($ibforums->vars['reg_auth_type'] == 'user') or ($ibforums->vars['reg_auth_type'] == 'admin') ) { - - // We want to validate all reg's via email, after email verificiation has taken place, - // we restore their previous group and remove the validate_key - - $DB->query("UPDATE ibf_members SET validate_key='$validate_key', prev_group='".$ibforums->vars['member_group']."' " - ."WHERE id='$member_id'"); - - - if ( $ibforums->vars['reg_auth_type'] == 'user' ) - { - - $this->email->get_template("reg_validate"); - - $this->email->build_message( array( - 'THE_LINK' => $this->base_url_nosess."?act=Reg&CODE=03&uid=".urlencode($member_id)."&aid=".urlencode($validate_key), - 'NAME' => $member['name'], - 'PASSWORD' => $in_password, - 'MAN_LINK' => $this->base_url_nosess."?act=Reg&CODE=05", - 'EMAIL' => $member['email'], - 'ID' => $member_id, - 'CODE' => $validate_key, - ) - ); - - $this->email->subject = "Registration at ".$ibforums->vars['board_name']; - $this->email->to = $member['email']; - - $this->email->send_mail(); - - $this->output = $this->html->show_authorise( $member ); - - } - else if ( $ibforums->vars['reg_auth_type'] == 'admin' ) - { - $this->output = $this->html->show_preview( $member ); - } - - $this->page_title = $ibforums->lang['reg_success']; - - $this->nav = array( $ibforums->lang['nav_reg'] ); - } - - else - { - - // We don't want to preview, or get them to validate via email. - - $DB->query("UPDATE ibf_stats SET ". - "MEM_COUNT=MEM_COUNT+1, ". - "LAST_MEM_NAME='" . $member['name'] . "', ". - "LAST_MEM_ID='" . $member['id'] . "'"); - - if ($ibforums->vars['new_reg_notify']) { - - $date = $std->get_date( time(), 'LONG' ); - - $this->email->get_template("admin_newuser"); - - $this->email->build_message( array( - 'DATE' => $date, - 'MEMBER_NAME' => $member['name'], - ) - ); - - $this->email->subject = "New Registration at ".$ibforums->vars['board_name']; - $this->email->to = $ibforums->vars['email_in']; - $this->email->send_mail(); - } - - $text = $ibforums->lang['done_reg_2']; - $url = 'act=Login&CODE=00'; - - - $print->redirect_screen( $text, $url ); - } - - } - - /*****************************************************/ - // validate_user - // ------------------ - // Leave a message after the tone, and I'll amuse myself - // by pulling faces when hearing the message later. - /*****************************************************/ - - function validate_user() { - global $ibforums, $std, $DB, $print; - - //------------------------------------------------------------ - // Check for input and it's in a valid format. - //------------------------------------------------------------ - - $in_user_id = trim(urldecode($ibforums->input['uid'])); - $in_validate_key = trim(urldecode($ibforums->input['aid'])); - $in_type = trim($ibforums->input['type']); - - if ($in_type == "") - { - $in_type = 'reg'; - } - - //------------------------------------------------------------ - - if (! preg_match( "/^(?:[\d\w]){6,14}$/", $in_validate_key ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) ); - } - - //------------------------------------------------------------ - - if (! preg_match( "/^(?:\d){1,}$/", $in_user_id ) ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) ); - } - - //------------------------------------------------------------ - // Attempt to get the profile of the requesting user - //------------------------------------------------------------ - - $DB->query("SELECT id, name, validate_key, prev_group, mgroup, email, new_pass FROM ibf_members WHERE id='$in_user_id'"); - - if ( !$DB->get_num_rows() ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) ); - } - - //------------------------------------------------------------ - - $member = $DB->fetch_row(); - - //------------------------------------------------------------ - - if ( $member['id'] == "" ) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) ); - } - - //------------------------------------------------------------ - if ( $member['validate_key'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_key' ) ); - } - else if ($member['validate_key'] != $in_validate_key) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_key_wrong' ) ); - } - else - { - //------------------------------------------------------------ - // Update the member... - //------------------------------------------------------------ - - if ($in_type == 'reg') - { - - if (empty($member['prev_group'])) - { - $member['prev_group'] = $ibforums->vars['member_group']; - } - - $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); - - //------------------------------------------------------------ - // Update the stats... - //------------------------------------------------------------ - - $DB->query("UPDATE ibf_stats SET ". - "MEM_COUNT=MEM_COUNT+1, ". - "LAST_MEM_NAME='" . $member['name'] . "', ". - "LAST_MEM_ID='" . $member['id'] . "'"); - - if ($ibforums->vars['new_reg_notify']) { - - $date = $std->get_date( time(), 'LONG' ); - - $this->email->get_template("admin_newuser"); - - $this->email->build_message( array( - 'DATE' => $date, - 'MEMBER_NAME' => $member['name'], - ) - ); - - $this->email->subject = "New Registration at ".$ibforums->vars['board_name']; - $this->email->to = $ibforums->vars['email_in']; - $this->email->send_mail(); - } - - } - else if ($in_type == 'lostpass') - { - - if ($member['new_pass'] == "") - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'lp_no_pass' ) ); - } - - $DB->query("UPDATE ibf_members SET password='".$member['new_pass']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); - - } - else if ($in_type == 'newemail') - { - if (empty($member['prev_group'])) - { - $member['prev_group'] = $ibforums->vars['member_group']; - } - - $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); - } - - $text = $ibforums->lang['done_reg_2']; - $url = 'act=Login&CODE=00'; - - - $print->redirect_screen( $text, $url ); - } - - } - - /*****************************************************/ - // show_board_rules - // ------------------ - // o_O ^^ - /*****************************************************/ - - function show_board_rules() { - global $ibforums, $DB; - - $DB->query("SELECT RULES_TEXT from ib_forum_rules WHERE ID='00'"); - $rules = $DB->fetch_row(); - - $this->output = $this->html->show_rules($rules); - $this->page_title = $ibforums->lang['board_rules']; - $this->nav = array( $ibforums->lang['board_rules'] ); - - } - - /*****************************************************/ - // show_manual_form - // ------------------ - // This feature is not available in an auto option - /*****************************************************/ - - function show_manual_form($type='reg') { - global $ibforums; - - $this->output = $this->html->show_dumb_form($type); - $this->page_title = $ibforums->lang['activation_form']; - $this->nav = array( $ibforums->lang['activation_form'] ); - - } - - -} - -?> + Registration functions +| > Module written by Matt Mecham +| > Date started: 16th February 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new Register; + +class Register { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $html = ""; + var $email = ""; + + function Register() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------------- + // Require the HTML and language modules + //-------------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_register', $ibforums->lang_id ); + + $this->html = $std->load_template('skin_register'); + + $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; + $this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}"; + + //-------------------------------------------- + // Get the emailer module + //-------------------------------------------- + + require "./sources/lib/emailer.php"; + + $this->email = new emailer(); + + //-------------------------------------------- + // What to do? + //-------------------------------------------- + + switch($ibforums->input['CODE']) { + + + case '02': + $this->create_account(); + break; + + case '03': + $this->validate_user(); + break; + + case '05': + $this->show_manual_form(); + break; + + case '06': + $this->show_manual_form('lostpass'); + break; + + case '07': + $this->show_manual_form('newemail'); + break; + + case '10': + $this->lost_password_start(); + break; + case '11': + $this->lost_password_end(); + break; + + case '12': + $this->coppa_perms_form(); + break; + + case 'coppa_two': + $this->coppa_two(); + break; + + case 'image': + $this->show_image(); + break; + + + default: + if ($ibforums->vars['use_coppa'] == 1 and $ibforums->input['coppa_pass'] != 1) + { + $this->coppa_start(); + } + else + { + $this->show_reg_form(); + } + break; + } + + // If we have any HTML to print, do so... + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + + /*****************************************************/ + // Coppa Start + // ------------------ + // Asks the registree if they are an old git or not + /*****************************************************/ + + function coppa_perms_form() + { + global $ibforums, $DB, $std; + + echo($this->html->coppa_form()); + exit(); + } + + + + function coppa_start() + { + global $ibforums, $DB, $std; + + $coppa_date = date( 'j-F y', mktime(0,0,0,date("m"),date("d"),date("Y")-13) ); + + $ibforums->lang['coppa_form_text'] = str_replace( "<#FORM_LINK#>", "{$ibforums->lang['coppa_link_form']}", $ibforums->lang['coppa_form_text']); + + $this->output .= $this->html->coppa_start($coppa_date); + + $this->page_title = $ibforums->lang['coppa_title']; + + $this->nav = array( $ibforums->lang['coppa_title'] ); + + } + + function coppa_two() + { + global $ibforums, $DB, $std; + + $ibforums->lang['coppa_form_text'] = str_replace( "<#FORM_LINK#>", "{$ibforums->lang['coppa_link_form']}", $ibforums->lang['coppa_form_text']); + + $this->output .= $this->html->coppa_two(); + + $this->page_title = $ibforums->lang['coppa_title']; + + $this->nav = array( $ibforums->lang['coppa_title'] ); + + } + + /*****************************************************/ + // lost_password_start + // ------------------ + // Simply shows the lostpassword form + // What do you want? Blood? + /*****************************************************/ + + function lost_password_start() + { + global $ibforums, $DB, $std; + + $this->page_title = $ibforums->lang['lost_pass_form']; + + $this->nav = array( $ibforums->lang['lost_pass_form'] ); + + $this->output .= $this->html->lost_pass_form(); + } + + + + + function lost_password_end() + { + global $ibforums, $DB, $std, $HTTP_POST_VARS, $print; + + if ($HTTP_POST_VARS['member_name'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); + } + + //------------------------------------------------------------ + // Check for input and it's in a valid format. + //------------------------------------------------------------ + + $member_name = trim(strtolower($ibforums->input['member_name'])); + + if ($member_name == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_username' ) ); + } + + //------------------------------------------------------------ + // Attempt to get the user details from the DB + //------------------------------------------------------------ + + $DB->query("SELECT name, id, email, mgroup, validate_key FROM ibf_members WHERE LOWER(name)='$member_name'"); + + if ( !$DB->get_num_rows() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) ); + } + else + { + $member = $DB->fetch_row(); + + //------------------------------------------------------------ + // Is there a validation key? If so, we'd better not touch it + //------------------------------------------------------------ + + if ($member['mgroup'] == $ibforums->vars['auth_group']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'val_key_present' ) ); + } + + if ($member['id'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) ); + } + + $new_pass = $std->make_password(); + $validate_key = $std->make_password(); + $md5_pass = md5($new_pass); + + //------------------------------------------------------------ + // Update the DB for this member. + //------------------------------------------------------------ + + $DB->query("UPDATE ibf_members SET new_pass='$md5_pass', validate_key='$validate_key' WHERE id='".$member['id']."'"); + + //------------------------------------------------------------ + // Send out the email. + //------------------------------------------------------------ + + $this->email->get_template("lost_pass"); + + $this->email->build_message( array( + 'NAME' => $member['name'], + 'PASSWORD' => $new_pass, + 'MAN_LINK' => $this->base_url_nosess."?act=Reg&CODE=06", + 'EMAIL' => $member['email'], + 'ID' => $member['id'], + 'CODE' => $validate_key, + 'IP_ADDRESS' => $ibforums->input['IP_ADDRESS'], + ) + ); + + $this->email->subject = $ibforums->lang['lp_subject'].' '.$ibforums->vars['board_name']; + $this->email->to = $member['email']; + + $this->email->send_mail(); + + $std->my_setcookie( 'pass_hash' , '-1', 0 ); + + $print->redirect_screen( $ibforums->lang['lp_redirect'], 'act=Reg&CODE=06' ); + } + + } + + /*****************************************************/ + // show_reg_form + // ------------------ + // Simply shows the registration form, no - really! Thats + // all it does. It doesn't make the tea or anything. + // Just the registration form, no more - no less. + // Unless your server went down, then it's just useless. + /*****************************************************/ + + function show_reg_form($errors = "") { + global $ibforums, $DB, $std; + + if ($ibforums->vars['no_reg'] == 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) ); + } + + if ($ibforums->vars['reg_auth_type']) + { + $ibforums->lang['std_text'] .= "
    " . $ibforums->lang['email_validate_text']; + } + + //----------------------------------------------- + // Clean out anti-spam stuffy + //----------------------------------------------- + + if ($ibforums->vars['reg_antispam']) + { + + // Get a time roughly 6 hours ago... + + $r_date = time() - (60*60*6); + + // Remove old reg requests from the DB + + $DB->query("DELETE FROM ibf_reg_antispam WHERE ctime < '$r_date'"); + + // Set a new ID for this reg request... + + $regid = md5( uniqid(microtime()) ); + + // Set a new 6 character numerical string + + mt_srand ((double) microtime() * 1000000); + + $reg_code = mt_rand(100000,999999); + + // Insert into the DB + + $str = $DB->compile_db_insert_string( array ( + 'regid' => $regid, + 'regcode' => $reg_code, + 'ip_address' => $ibforums->input['IP_ADDRESS'], + 'ctime' => time(), + ) ); + + $DB->query("INSERT INTO ibf_reg_antispam ({$str['FIELD_NAMES']}) VALUES ({$str['FIELD_VALUES']})"); + + } + + //----------------------------------------------- + // Custom profile fields stuff + //----------------------------------------------- + + $required_output = ""; + $optional_output = ""; + $field_data = array(); + + $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 AND fshowreg=1 ORDER BY forder"); + + while( $row = $DB->fetch_row() ) + { + $form_element = ""; + + if ( $row['freq'] == 1 ) + { + $ftype = 'required_output'; + } + else + { + $ftype = 'optional_output'; + } + + if ( $row['ftype'] == 'drop' ) + { + $carray = explode( '|', trim($row['fcontent']) ); + + $d_content = ""; + + foreach( $carray as $entry ) + { + $value = explode( '=', $entry ); + + $ov = trim($value[0]); + $td = trim($value[1]); + + if ($ov !="" and $td !="") + { + $d_content .= "\n"; + } + } + + if ($d_content != "") + { + $form_element = $this->html->field_dropdown( 'field_'.$row['fid'], $d_content ); + } + } + else if ( $row['ftype'] == 'area' ) + { + $form_element = $this->html->field_textarea( 'field_'.$row['fid'], "" ); + } + else + { + $form_element = $this->html->field_textinput( 'field_'.$row['fid'], "" ); + } + + ${$ftype} .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element ); + } + + $this->page_title = $ibforums->lang['registration_form']; + $this->nav = array( $ibforums->lang['registration_form'] ); + + $coppa = ($ibforums->input['coppa_user'] == 1) ? 1 : 0; + + if ($errors != "") + { + $this->output .= $this->html->errors( $ibforums->lang[$errors]); + } + + $this->output .= $this->html->ShowForm( array( 'TEXT' => $ibforums->lang['std_text'], + 'RULES' => $ibforums->lang['click_wrap'], + 'coppa_user' => $coppa, + ) ); + + if ($ibforums->vars['reg_antispam']) + { + $this->output = str_replace( "", $this->html->reg_antispam( $regid ), $this->output ); + } + + if ($required_output != "") + { + $this->output = str_replace( "", "\n".$required_output, $this->output ); + } + + if ($optional_output != "") + { + $this->output = str_replace( "", $this->html->optional_title()."\n".$optional_output, $this->output ); + } + } + + /*****************************************************/ + // create_account + // ------------------ + // Now this is a really good subroutine. It adds the member + // to the members table in the database. Yes, really fancy + // this one. It also finds the time to see if we need to + // check any email verification type malarky before we + // can use this brand new account. It's like buying a new + // car and getting it towed home and being told the keys + // will be posted later. Although you can't polish this + // routine while you're waiting. + /*****************************************************/ + + function create_account() { + global $ibforums, $std, $DB, $print, $HTTP_POST_VARS; + + if ($HTTP_POST_VARS['act'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); + } + + if ($ibforums->vars['no_reg'] == 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'reg_off' ) ); + } + + $coppa = ($ibforums->input['coppa_user'] == 1) ? 1 : 0; + + //---------------------------------- + // Custom profile field stuff + //---------------------------------- + + $custom_fields = array(); + + $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1"); + + while ( $row = $DB->fetch_row() ) + { + if ($row['freq'] == 1) + { + if ($HTTP_POST_VARS[ 'field_'.$row['fid'] ] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); + } + } + + if ($row['fmaxinput'] > 0) + { + if (strlen($HTTP_POST_VARS[ 'field_'.$row['fid'] ]) > $row['fmaxinput']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cf_to_long', 'EXTRA' => $row['ftitle'] ) ); + } + } + + $custom_fields[ 'field_'.$row['fid'] ] = $ibforums->input[ 'field_'.$row['fid'] ]; + } + + //--------------------------------------- + // Trim off the username and password + + $in_username = trim($ibforums->input['UserName']); + $in_password = trim($ibforums->input['PassWord']); + $in_email = strtolower( trim($ibforums->input['EmailAddress']) ); + + $ibforums->input['EmailAddress_two'] = strtolower( trim($ibforums->input['EmailAddress_two']) ); + + if ($ibforums->input['EmailAddress_two'] != $in_email) + { + $this->show_reg_form('err_email_address_match'); + return; + } + + //+-------------------------------------------- + //| Check for errors in the input. + //+-------------------------------------------- + + if (empty($in_username)) + { + $this->show_reg_form('err_no_username'); + return; + } + if (strlen($in_username) < 3) + { + $this->show_reg_form('err_no_username'); + return; + } + if (strlen($in_username) > 32) + { + $this->show_reg_form('err_no_username'); + return; + } + if (empty($in_password)) + { + $this->show_reg_form('err_no_password'); + return; + } + if (strlen($in_password) < 3) + { + $this->show_reg_form('err_no_password'); + return; + } + if (strlen($in_password) > 32) + { + $this->show_reg_form('err_no_password'); + return; + } + if ($ibforums->input['PassWord_Check'] != $in_password) + { + $this->show_reg_form('err_pass_match'); + return; + } + if (strlen($in_email) < 6) + { + $this->show_reg_form('err_invalid_email'); + return; + } + + //+-------------------------------------------- + //| Check the email address + //+-------------------------------------------- + + $in_email = $std->clean_email($in_email); + + if (! $in_email ) + { + $this->show_reg_form('err_invalid_email'); + return; + } + + //+-------------------------------------------- + //| Is this name already taken? + //+-------------------------------------------- + + $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".strtolower($in_username)."'"); + $name_check = $DB->fetch_row(); + + if ($name_check['id']) + { + $this->show_reg_form('err_user_exists'); + return; + } + + if (strtolower($in_username) == 'guest') + { + $this->show_reg_form('err_user_exists'); + return; + } + + //+-------------------------------------------- + //| Is this email addy taken? + //+-------------------------------------------- + + if (! $ibforums->vars['allow_dup_email'] ) + { + $DB->query("SELECT id FROM ibf_members WHERE email='".$in_email."'"); + $email_check = $DB->fetch_row(); + if ($email_check['id']) + { + $this->show_reg_form('err_email_exists'); + return; + } + } + + //+-------------------------------------------- + //| Are they in the reserved names list? + //+-------------------------------------------- + + if ($ibforums->vars['ban_names']) + { + $names = explode( "|" , $ibforums->vars['ban_names'] ); + foreach ($names as $n) + { + if (preg_match( "/$n/i", $in_username )) + { + $this->show_reg_form('err_user_exists'); + break; + return; + } + } + } + + //+-------------------------------------------- + //| Are they banned? + //+-------------------------------------------- + + if ($ibforums->vars['ban_ip']) + { + $ips = explode( "|", $ibforums->vars['ban_ip'] ); + foreach ($ips as $ip) + { + $ip = preg_replace( "/\*/", '.*' , $ip ); + if (preg_match( "/$ip/", $ibforums->input['IP_ADDRESS'] )) + { + $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); + } + } + } + + if ($ibforums->vars['ban_email']) + { + $ips = explode( "|", $ibforums->vars['ban_email'] ); + foreach ($ips as $ip) + { + $ip = preg_replace( "/\*/", '.*' , $ip ); + if (preg_match( "/$ip/", $in_email )) + { + $std->Error( array( LEVEL => 1, MSG => 'you_are_banned' ) ); + } + } + } + + //+-------------------------------------------- + //| Check the reg_code + //+-------------------------------------------- + + if ($ibforums->vars['reg_antispam']) + { + if ($ibforums->input['regid'] == "") + { + $this->show_reg_form('err_reg_code'); + return; + } + + $DB->query("SELECT * FROM ibf_reg_antispam WHERE regid='".trim(addslashes($ibforums->input['regid']))."'"); + + if ( ! $row = $DB->fetch_row() ) + { + $this->show_reg_form('err_reg_code'); + return; + } + + if ( trim( intval($ibforums->input['reg_code']) ) != $row['regcode'] ) + { + $this->show_reg_form('err_reg_code'); + return; + } + } + + //+-------------------------------------------- + //| Build up the hashes + //+-------------------------------------------- + + $mem_group = $ibforums->vars['member_group']; + + //+-------------------------------------------- + //| Are we asking the member or admin to preview? + //+-------------------------------------------- + + if ($ibforums->vars['reg_auth_type']) + { + $mem_group = $ibforums->vars['auth_group']; + } + else if ($coppa == 1) + { + $mem_group = $ibforums->vars['auth_group']; + } + + //+-------------------------------------------- + //| Find the highest member id, and increment it + //| auto_increment not used for guest id 0 val. + //+-------------------------------------------- + + $DB->query("SELECT MAX(id) as new_id FROM ibf_members"); + $r = $DB->fetch_row(); + + $member_id = $r['new_id'] + 1; + + $member = array( + 'id' => $member_id, + 'name' => $in_username, + 'password' => $in_password, + 'email' => $in_email, + 'mgroup' => $mem_group, + 'posts' => 0, + 'avatar' => 'noavatar', + 'joined' => time(), + 'ip_address' => $ibforums->input['IP_ADDRESS'], + 'time_offset' => $ibforums->vars['time_offset'], + 'view_sigs' => 1, + 'email_pm' => 1, + 'view_img' => 1, + 'view_avs' => 1, + 'allow_post' => 1, + 'view_pop' => 1, + 'vdirs' => "in:Inbox|sent:Sent Items", + 'msg_total' => 0, + 'new_msg' => 0, + 'coppa_user' => $coppa, + ); + + + + //+-------------------------------------------- + //| Insert into the DB + //+-------------------------------------------- + + $member['password'] = md5( $member['password'] ); + + $db_string = $std->compile_db_string( $member ); + + $DB->query("INSERT INTO ibf_members (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + unset($db_string); + + //+-------------------------------------------- + //| Insert into the custom profile fields DB + //+-------------------------------------------- + + $custom_fields['member_id'] = $member['id']; + + $db_string = $DB->compile_db_insert_string($custom_fields); + + $DB->query("INSERT INTO ibf_pfields_content (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + unset($db_string); + + //+-------------------------------------------- + + $validate_key = $std->make_password(); + $time = time(); + + + if ($coppa != 1) + { + if ( ($ibforums->vars['reg_auth_type'] == 'user') or ($ibforums->vars['reg_auth_type'] == 'admin') ) { + + // We want to validate all reg's via email, after email verificiation has taken place, + // we restore their previous group and remove the validate_key + + $DB->query("UPDATE ibf_members SET validate_key='$validate_key', prev_group='".$ibforums->vars['member_group']."' " + ."WHERE id='$member_id'"); + + + if ( $ibforums->vars['reg_auth_type'] == 'user' ) + { + + $this->email->get_template("reg_validate"); + + $this->email->build_message( array( + 'THE_LINK' => $this->base_url_nosess."?act=Reg&CODE=03&uid=".urlencode($member_id)."&aid=".urlencode($validate_key), + 'NAME' => $member['name'], + 'PASSWORD' => $in_password, + 'MAN_LINK' => $this->base_url_nosess."?act=Reg&CODE=05", + 'EMAIL' => $member['email'], + 'ID' => $member_id, + 'CODE' => $validate_key, + ) + ); + + $this->email->subject = "Registration at ".$ibforums->vars['board_name']; + $this->email->to = $member['email']; + + $this->email->send_mail(); + + $this->output = $this->html->show_authorise( $member ); + + } + else if ( $ibforums->vars['reg_auth_type'] == 'admin' ) + { + $this->output = $this->html->show_preview( $member ); + } + + $this->page_title = $ibforums->lang['reg_success']; + + $this->nav = array( $ibforums->lang['nav_reg'] ); + } + + else + { + + // We don't want to preview, or get them to validate via email. + + $DB->query("UPDATE ibf_stats SET ". + "MEM_COUNT=MEM_COUNT+1, ". + "LAST_MEM_NAME='" . $member['name'] . "', ". + "LAST_MEM_ID='" . $member['id'] . "'"); + + if ($ibforums->vars['new_reg_notify']) { + + $date = $std->get_date( time(), 'LONG' ); + + $this->email->get_template("admin_newuser"); + + $this->email->build_message( array( + 'DATE' => $date, + 'MEMBER_NAME' => $member['name'], + ) + ); + + $this->email->subject = "New Registration at ".$ibforums->vars['board_name']; + $this->email->to = $ibforums->vars['email_in']; + $this->email->send_mail(); + } + + $std->my_setcookie("member_id" , $member['id'] , 1); + $std->my_setcookie("pass_hash" , $member['password'], 1); + + $std->boink_it($ibforums->base_url.'&act=Login&CODE=autologin&fromreg=1'); + } + } + else + { + // This is a COPPA user, so lets tell them they registered OK and redirect to the form. + + $print->redirect_screen( $ibforums->lang['cp_success'], 'act=Reg&CODE=12' ); + } + + } + + /*****************************************************/ + // validate_user + // ------------------ + // Leave a message after the tone, and I'll amuse myself + // by pulling faces when hearing the message later. + /*****************************************************/ + + function validate_user() { + global $ibforums, $std, $DB, $print; + + //------------------------------------------------------------ + // Check for input and it's in a valid format. + //------------------------------------------------------------ + + $in_user_id = trim(urldecode($ibforums->input['uid'])); + $in_validate_key = trim(urldecode($ibforums->input['aid'])); + $in_type = trim($ibforums->input['type']); + + if ($in_type == "") + { + $in_type = 'reg'; + } + + //------------------------------------------------------------ + + if (! preg_match( "/^(?:[\d\w]){6,14}$/", $in_validate_key ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) ); + } + + //------------------------------------------------------------ + + if (! preg_match( "/^(?:\d){1,}$/", $in_user_id ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'data_incorrect' ) ); + } + + //------------------------------------------------------------ + // Attempt to get the profile of the requesting user + //------------------------------------------------------------ + + $DB->query("SELECT id, name, validate_key, prev_group, mgroup, email, new_pass FROM ibf_members WHERE id='$in_user_id'"); + + if ( !$DB->get_num_rows() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) ); + } + + //------------------------------------------------------------ + + $member = $DB->fetch_row(); + + //------------------------------------------------------------ + + if ( $member['id'] == "" ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_mem' ) ); + } + + //------------------------------------------------------------ + if ( $member['validate_key'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_no_key' ) ); + } + else if ($member['validate_key'] != $in_validate_key) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'auth_key_wrong' ) ); + } + else + { + //------------------------------------------------------------ + // Update the member... + //------------------------------------------------------------ + + if ($in_type == 'reg') + { + + if (empty($member['prev_group'])) + { + $member['prev_group'] = $ibforums->vars['member_group']; + } + + $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); + + //------------------------------------------------------------ + // Update the stats... + //------------------------------------------------------------ + + $DB->query("UPDATE ibf_stats SET ". + "MEM_COUNT=MEM_COUNT+1, ". + "LAST_MEM_NAME='" . $member['name'] . "', ". + "LAST_MEM_ID='" . $member['id'] . "'"); + + if ($ibforums->vars['new_reg_notify']) { + + $date = $std->get_date( time(), 'LONG' ); + + $this->email->get_template("admin_newuser"); + + $this->email->build_message( array( + 'DATE' => $date, + 'MEMBER_NAME' => $member['name'], + ) + ); + + $this->email->subject = "New Registration at ".$ibforums->vars['board_name']; + $this->email->to = $ibforums->vars['email_in']; + $this->email->send_mail(); + } + + } + else if ($in_type == 'lostpass') + { + + if ($member['new_pass'] == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'lp_no_pass' ) ); + } + + $DB->query("UPDATE ibf_members SET password='".$member['new_pass']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); + + } + else if ($in_type == 'newemail') + { + if (empty($member['prev_group'])) + { + $member['prev_group'] = $ibforums->vars['member_group']; + } + + $DB->query("UPDATE ibf_members SET mgroup='".$member['prev_group']."', prev_group='', validate_key='', new_pass='' WHERE id='".$member['id']."'"); + } + + $text = $ibforums->lang['done_reg_2']; + $url = 'act=Login&CODE=00'; + + + $print->redirect_screen( $text, $url ); + } + + } + + /*****************************************************/ + // show_board_rules + // ------------------ + // o_O ^^ + /*****************************************************/ + + function show_board_rules() { + global $ibforums, $DB; + + $DB->query("SELECT RULES_TEXT from ib_forum_rules WHERE ID='00'"); + $rules = $DB->fetch_row(); + + $this->output = $this->html->show_rules($rules); + $this->page_title = $ibforums->lang['board_rules']; + $this->nav = array( $ibforums->lang['board_rules'] ); + + } + + /*****************************************************/ + // show_manual_form + // ------------------ + // This feature is not available in an auto option + /*****************************************************/ + + function show_manual_form($type='reg') { + global $ibforums; + + $this->output = $this->html->show_dumb_form($type); + $this->page_title = $ibforums->lang['activation_form']; + $this->nav = array( $ibforums->lang['activation_form'] ); + + } + + function show_image() + { + global $ibforums, $DB; + + // Init array + + $numbers = array( 0 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKsOnmqSPjtT1ZdnnjCUqBQAOw==', + 1 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUjAEWyMqoXIprRkjxtZJWrz3iCBQAOw==', + 2 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKubnpPzRQvoVbvyrDHiWAAAOw==', + 3 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKbaHgRyUZtmlPtlfnnMiGUFADs=', + 4 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjAN5mLDtjFJMRjpj1Rv6v1SHN0IFADs=', + 5 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhA+Bpxn/DITL1SRjnps63l1M9RQAOw==', + 6 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjIEYyWwH3lNyrQTbnVh2Tl3N5wQFADs=', + 7 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhI9pwbztAAwP1napnFnzbYEYWAAAOw==', + 8 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKubHgSPWXoxVUxC33FZZCkFADs=', + 9 => 'R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDA6hyJabnnISnsnybXdS73hcZlUFADs=', + ); + + if ( $ibforums->input['p'] == "" ) + { + return false; + } + + if ( $ibforums->input['rc'] == "" ) + { + return false; + } + + // Get the info from the db + + $DB->query("SELECT * FROM ibf_reg_antispam WHERE regid='".trim(addslashes($ibforums->input['rc']))."'"); + + if ( ! $row = $DB->fetch_row() ) + { + return false; + } + + $p = intval($ibforums->input['p']) - 1; //substr starts from 0, not 1 :p + + $this_number = substr( $row['regcode'], $p, 1 ); + + flush(); + header("Content-type: image/gif"); + echo base64_decode($numbers[ $this_number ]); + exit(); + + } + + +} + +?> diff --git a/upload/sources/Search.php b/upload/sources/Search.php index 55138938..3ce3604a 100644 --- a/upload/sources/Search.php +++ b/upload/sources/Search.php @@ -1,1049 +1,1614 @@ - Searching procedures -| > Module written by Matt Mecham -| > Date started: 24th February 2002 -| -| > Module Version Number: 1.0.0 -+-------------------------------------------------------------------------- -| -| MODULE NOTES: -| ------------- -| -| I've been deliberating whether we should implement some kind of WORD ID / -| search logging table for index. -| iB3 PERL had such a feature, but that was to aide the DBM searches, which -| were slow at best. -| The biggest complaint we had was that adding a word ID / search logging table -| effectively doubled the amount of space needed in the mySQL database. I've seen -| this complaint echo'd on the support boards of other forum software. -| The other downside to such a feature would be the overhaul needed to update it -| with new posts/topics and topic movement / deletion. -| -| I figure that people post more than they search, so a full table scan once per -| search request is offset against the CPU to keep the search log tables up to date -| -| I'm going to stick my neck out and go the full table scan route. It's not as effecient -| as a search table would be, but the benefits include no overhead updating it, and a smaller -| overall DB size - which is vital to some people on certain hosts. -| -| This may change if it becomes apparent that it's not very efficient in the long run -+-------------------------------------------------------------------------- -*/ - -// - -$idx = new Search; - -class Search { - - var $output = ""; - var $page_title = ""; - var $nav = array(); - var $html = ""; - - var $first = 0; - - var $search_type = 'posts'; - var $sort_order = 'desc'; - var $sort_key = 'last_post'; - var $search_in = 'posts'; - var $prune = '30'; - var $st_time = array(); - var $end_time = array(); - var $st_stamp = ""; - var $end_stamp = ""; - - function Search() { - global $ibforums, $DB, $std, $print; - - if (! $ibforums->vars['allow_search']) - { - $std->Error( array( LEVEL => 1, MSG => 'search_off') ); - } - - if ($ibforums->member['g_use_search'] != 1) - { - $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); - } - - - if ($ibforums->input['CODE'] == "") $ibforums->input['CODE'] = '00'; - - //-------------------------------------------- - // Require the HTML and language modules - //-------------------------------------------- - - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_search', $ibforums->lang_id ); - $ibforums->lang = $std->load_words($ibforums->lang, 'lang_forum' , $ibforums->lang_id ); - - require "./Skin/".$ibforums->skin_id."/skin_search.php"; - - $this->html = new skin_search(); - - $this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}"; - - if (isset($ibforums->input['st']) ) - { - $this->first = $ibforums->input['st']; - } - - //-------------------------------------------- - // What to do? - //-------------------------------------------- - - if (! isset($ibforums->member['g_use_search']) ) - { - $std->Error( array( LEVEL => 1, MSG => 'cant_use_feature') ); - } - - switch($ibforums->input['CODE']) { - case '01': - $this->do_search(); - break; - case '03': - $this->get_new_posts(); - break; - case 'getactive': - $this->get_active(); - break; - case 'show': - $this->show_results(); - break; - default: - $this->show_form(); - break; - } - - // If we have any HTML to print, do so... - - $print->add_output("$this->output"); - $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); - - } - - function show_form() { - global $DB, $std, $ibforums; - - $last_cat_id = -1; - - $the_hiddens = ""; - - $DB->query("SELECT f.id as forum_id, f.name as forum_name, f.position, f.read_perms, c.id as cat_id, c.name as cat_name from ibf_forums f, ibf_categories c where c.id=f.category ORDER BY c.position, f.position"); - - $forums = "\n" - .""; } + //----------------------------------------------- + // Custom profile fields stuff + //----------------------------------------------- + + $required_output = ""; + $optional_output = ""; + $field_data = array(); + + $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'"); + + while ( $content = $DB->fetch_row() ) + { + foreach($content as $k => $v) + { + if ( preg_match( "/^field_(\d+)$/", $k, $match) ) + { + $field_data[ $match[1] ] = $v; + //break; + } + } + } + + $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 ORDER BY forder"); + + while( $row = $DB->fetch_row() ) + { + $form_element = ""; + + if ( $row['freq'] == 1 ) + { + $ftype = 'required_output'; + } + else + { + $ftype = 'optional_output'; + } + + if ( $row['ftype'] == 'drop' ) + { + $carray = explode( '|', trim($row['fcontent']) ); + + $d_content = ""; + + foreach( $carray as $entry ) + { + $value = explode( '=', $entry ); + + $ov = trim($value[0]); + $td = trim($value[1]); + + if ($ov !="" and $td !="") + { + $d_content .= ($field_data[$row['fid']] == $ov) ? "\n" + : "\n"; + } + } + + if ($d_content != "") + { + $form_element = $this->html->field_dropdown( 'field_'.$row['fid'], $d_content ); + } + } + else if ( $row['ftype'] == 'area' ) + { + $form_element = $this->html->field_textarea( 'field_'.$row['fid'], $field_data[$row['fid']] ); + } + else + { + $form_element = $this->html->field_textinput( 'field_'.$row['fid'], $field_data[$row['fid']] ); + } + + ${$ftype} .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element ); + } + //----------------------------------------------- // Format the interest / location boxes //----------------------------------------------- @@ -998,20 +1305,6 @@ class UserCP { $this->member['location'] = $this->parser->unconvert( $this->member['location'] ); $this->member['interests'] = $this->parser->unconvert( $this->member['interests'] ); - //----------------------------------------------- - // Format the siggie (no, not ciggie - smoking is - // bad boys and girls) - //----------------------------------------------- - - if ($ibforums->vars['sig_allow_html']) - { - $this->member['signature'] = $std->text_tidy($this->member['signature']); - } - else - { - $this->member['signature'] = $this->parser->unconvert($this->member['signature']); - } - //----------------------------------------------- // Suck up the HTML and swop some tags if need be //----------------------------------------------- @@ -1028,6 +1321,20 @@ class UserCP { $this->output = preg_replace( "//", $t_html, $this->output ); + //----------------------------------------------- + // Add in the custom fields if we need to. + //----------------------------------------------- + + if ($required_output != "") + { + $this->output = str_replace( "", $this->html->required_title()."\n".$required_output, $this->output ); + } + + if ($optional_output != "") + { + $this->output = str_replace( "", "\n".$optional_output, $this->output ); + } + $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "".$ibforums->lang['t_title']."" ); @@ -1087,16 +1394,16 @@ class UserCP { $info['space_free'] = "Unlimited"; $info['total_messages'] = $total['msg_total']; - if ($ibforums->vars['max_messages'] > 0) + if ($ibforums->member['g_max_messages'] > 0) { - if ($total['msg_total'] >= $ibforums->vars['max_messages']) + if ($total['msg_total'] >= $ibforums->member['g_max_messages']) { - $info['full_messenger'] = "".$ibforums->lang['folders_full'].""; + $info['full_messenger'] = "".$ibforums->lang['folders_full'].""; } - $info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->vars['max_messages']) * 100) ) : 0; + $info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->member['g_max_messages']) * 100) ) : 0; $info['full_percent'] = "(". $info['full_percent'] .'% '. $ibforums->lang['total_capacity'] . ")"; - $info['space_free'] = $ibforums->vars['max_messages'] - $total['msg_total']; + $info['space_free'] = $ibforums->member['g_max_messages'] - $total['msg_total']; } diff --git a/upload/sources/browsebuddy.php b/upload/sources/browsebuddy.php new file mode 100644 index 00000000..6942b587 --- /dev/null +++ b/upload/sources/browsebuddy.php @@ -0,0 +1,159 @@ + Browse Buddy Module +| > Module written by Matt Mecham +| > Date started: 2nd July 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new buddy; + +class buddy { + + var $output = ""; + var $page_title = ""; + var $nav = array(); + var $html = ""; + + + + function buddy() { + global $ibforums, $DB, $std, $print; + + //-------------------------------------------- + // Require the HTML and language modules + //-------------------------------------------- + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_buddy', $ibforums->lang_id ); + + $this->html = $std->load_template('skin_buddy'); + + //-------------------------------------------- + // What to do? + //-------------------------------------------- + + switch($ibforums->input['code']) { + + default: + $this->splash(); + break; + } + + // If we have any HTML to print, do so... + + $this->output = str_replace( "", $this->html->closelink(), $this->output ); + + $print->pop_up_window($ibforums->lang['page_title'], $this->html->buddy_js().$this->output); + + + } + + function splash() { + global $ibforums, $DB, $std; + + //-------------------------------------------- + // Is this a guest? If so, get 'em to log in. + //-------------------------------------------- + + if ( ! $ibforums->member['id'] ) + { + $this->output = $this->html->login(); + return; + } + else + { + + //-------------------------------------------- + // Get the forums we're allowed to search in + //-------------------------------------------- + + $allow_forums = array(); + + $allow_forums[] = '0'; + + $DB->query("SELECT id, read_perms FROM ibf_forums"); + + while( $forum = $DB->fetch_row() ) + { + if ( $forum['read_perms'] == '*' ) + { + $allow_forums[] = $forum['id']; + } + else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $forum['read_perms']) ) + { + $allow_forums[] = $forum['id']; + } + } + + $forum_string = implode( ",", $allow_forums ); + + //-------------------------------------------- + // Get the number of posts since the last visit. + //-------------------------------------------- + + if (! $ibforums->member['last_visit'] ) + { + $ibforums->member['last_visit'] = time() - 3600; + } + + $DB->query("SELECT COUNT(pid) as posts FROM ibf_posts WHERE post_date > '".$ibforums->member['last_visit']."' AND queued <> 1 AND forum_id IN($forum_string)"); + + $posts = $DB->fetch_row(); + + $posts_total = ($posts['posts'] < 1) ? 0 : $posts['posts']; + + //----------------------------------------------------------------------- + // Get the number of posts since the last visit to topics we've started. + //----------------------------------------------------------------------- + + $DB->query("SELECT COUNT(tid) as replies FROM ibf_topics WHERE last_post > '".$ibforums->member['last_visit']."' AND approved=1 AND forum_id IN($forum_string) AND starter_id='".$ibforums->member['id']."'"); + + $topic = $DB->fetch_row(); + + $topics_total = ($topic['replies'] < 1) ? ucfirst($ibforums->lang['none']) : $topic['replies']; + + $text = $ibforums->lang['no_new_posts']; + + if ($posts_total > 0) + { + $ibforums->lang['new_posts'] = sprintf($ibforums->lang['new_posts'] , $posts_total ); + $ibforums->lang['my_replies'] = sprintf($ibforums->lang['my_replies'], $topics_total ); + + $ibforums->lang['new_posts'] .= $this->html->append_view("&act=Search&CODE=getnew"); + + if ($topic['replies'] > 0) + { + $ibforums->lang['my_replies'] .= $this->html->append_view("&act=Search&CODE=getreplied"); + } + + $text = $this->html->build_away_msg(); + } + + + $this->output = $this->html->main($text); + } + + + } + + + +} + +?> diff --git a/upload/sources/calendar.php b/upload/sources/calendar.php new file mode 100644 index 00000000..52b40173 --- /dev/null +++ b/upload/sources/calendar.php @@ -0,0 +1,1299 @@ + Calendar functions library +| > Module written by Matt Mecham +| > Date started: 12th June 2002 +| +| > Module Version Number: 1.0.0 ++-------------------------------------------------------------------------- +*/ + + +$idx = new calendar; + +class calendar { + + var $output = ""; + var $base_url = ""; + var $html = ""; + var $output = ""; + var $page_title = ""; + var $nav; + + var $chosen_month = ""; + var $chosen_year = ""; + var $now_date = ""; + var $our_datestamp = ""; + var $offset = ""; + var $start_date = ""; + var $first_day_array = ""; + var $month_words = array(); + var $day_words = array(); + + + function calendar() { + global $ibforums, $DB, $std, $print, $skin_universal; + + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_calendar', $ibforums->lang_id); + $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post', $ibforums->lang_id); + + $this->html = $std->load_template('skin_calendar'); + + $this->post_html = $std->load_template('skin_post'); + + //----------------------------------------- + // Do some set up + //----------------------------------------- + + $this->offset = (($ibforums->member['time_offset'] != "") ? $ibforums->member['time_offset'] : $ibforums->vars['time_offset']) * 3600; + + if ($ibforums->vars['time_adjust'] != "" and $ibforums->vars['time_adjust'] != 0) + { + $this->offset += ($ibforums->vars['time_adjust'] * 60); + } + + /*if ($ibforums->member['dst_in_use']) + { + $this->offset += 3600; + }*/ + + //----------------------------------------- + // Prep our chosen dates + //----------------------------------------- + + $this->now_date = getdate( time() + $this->offset ); + + $this->chosen_month = (intval($ibforums->input['m']) == "") ? $this->now_date['mon'] : $ibforums->input['m']; + $this->chosen_year = (intval($ibforums->input['y']) == "") ? $this->now_date['year'] : $ibforums->input['y']; + + //----------------------------------------- + // Make sure the date is in range. + //----------------------------------------- + + if ( ! checkdate( $this->chosen_month, 1 , $this->chosen_year ) ) + { + $this->chosen_month = $this->now_date['mon']; + $this->chosen_year = $this->now_date['year']; + } + + //----------------------------------------- + // Get the timestamp for our chosen date + //----------------------------------------- + + $this->our_datestamp = mktime( 0, 0, 0, $this->chosen_month, 1, $this->chosen_year); + $this->first_day_array = getdate($this->our_datestamp); + + //----------------------------------------- + // Finally, build up the lang arrays + //----------------------------------------- + + $this->month_words = array( $ibforums->lang['M_1'] , $ibforums->lang['M_2'] , $ibforums->lang['M_3'] , + $ibforums->lang['M_4'] , $ibforums->lang['M_5'] , $ibforums->lang['M_6'] , + $ibforums->lang['M_7'] , $ibforums->lang['M_8'] , $ibforums->lang['M_9'] , + $ibforums->lang['M_10'], $ibforums->lang['M_11'], $ibforums->lang['M_12'] ); + + $this->day_words = array( $ibforums->lang['D_1'], $ibforums->lang['D_2'], + $ibforums->lang['D_3'], $ibforums->lang['D_4'], $ibforums->lang['D_5'], + $ibforums->lang['D_6'], $ibforums->lang['D_0'] ); + + + //----------------------------------------- + + switch( $ibforums->input['code'] ) + { + case 'newevent': + $this->new_event(); + break; + + case 'showday': + $this->show_day(); + break; + + case 'showevent': + $this->show_event(); + break; + + case 'addnewevent': + $this->add_new_event(); + break; + + case 'birthdays': + $this->show_birthdays(); + break; + + case 'edit': + $this->edit(); + break; + + case 'doedit': + $this->do_edit(); + break; + + default: + $this->show_month(); + break; + } + + //----------------------------------------- + + if ($this->page_title == "") + { + $this->page_title = $ibforums->vars['board_name']." ".$ibforums->lang['page_title']; + } + + if (! is_array($this->nav) ) + { + $this->nav[] = "{$ibforums->lang['page_title']}"; + } + + $print->add_output("$this->output"); + $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) ); + + } + + + //-------------------------------------- + // Display Edit / Delete boxes + //-------------------------------------- + + function edit() { + global $ibforums, $DB, $std, $print; + + if ( $ibforums->member['g_calendar_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + if ( ! $ibforums->member['id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + //----------------------------------------- + + $eventid = intval($ibforums->input['eventid']); + + if ($eventid == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + $DB->query("SELECT * FROM ibf_calendar_events WHERE eventid='$eventid'"); + + if ( ! $event = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + + $can_edit = 0; + + //----------------------------------------- + // Do we have permission to edit this event? + //----------------------------------------- + + if ($ibforums->member['id'] == $event['userid']) + { + $can_edit = 1; + } + else if ($ibforums->member['g_is_supmod'] == 1) + { + $can_edit = 1; + } + else + { + $can_edit = 0; + } + + if ($can_edit != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + // Do we have permission to see the event? + //----------------------------------------- + + if ( $event['read_perms'] != '*' ) + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + } + + //----------------------------------------- + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $ibforums->lang['edit_event']." ".$event['title']; + + //----------------------------------------- + + $this->output .= $this->post_html->calendar_start_edit_form($event['eventid']); + $this->output .= $this->post_html->table_top($ibforums->lang['edit_event']); + + $this->output .= $this->post_html->calendar_delete_box(); + + $this->output .= $this->post_html->calendar_event_title($event['title']); + $this->output .= $this->post_html->calendar_choose_date( + $this->get_day_dropdown($event['mday']), $this->get_month_dropdown($event['month']), $this->get_year_dropdown($event['year']) + ); + + $public = ""; + $private = ""; + + if ($event['priv_event'] == 1) + { + $private = ' selected'; + } + else + { + $public = ' selected'; + } + + $this->output .= $this->post_html->calendar_event_type($public, $private); + + if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) + { + // Get all the group ID's and names from the DB and build the selection box + + $group_choices = ""; + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $selected = ""; + + if ( preg_match( "/(^|,)".$r['g_id']."(,|$)/", $event['read_perms'] ) ) + { + $selected = ' selected'; + } + + $group_choices .= "\n"; + } + + $this->output .= $this->post_html->calendar_admin_group_box($group_choices); + } + + + + $this->output .= $this->post_html->postbox_buttons( str_replace( "
    ", "\n", $event['event_text'] ) ); + + $this->output .= $this->post_html->calendar_end_form($ibforums->lang['calendar_edit_submit']); + + + //-------------------------------------- + // Add in the smilies box + //-------------------------------------- + + $show_table = 0; + $count = 0; + $smilies = "\n"; + + // Get the smilies from the DB + + $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); + + while ($elmo = $DB->fetch_row() ) + { + + $show_table++; + $count++; + + $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; + + if ($count == $ibforums->vars['emo_per_row']) { + $smilies .= "\n\n"; + $count = 0; + } + } + + if ($count != $ibforums->vars['emo_per_row']) + { + for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { + $smilies .= " \n"; + } + $smilies .= ""; + } + + $table = $this->post_html->smilie_table(); + + if ($show_table != 0) + { + $table = preg_replace( "//", $smilies, $table ); + $this->output = preg_replace( "//", $table, $this->output ); + } + + // Remove the "add sig" box + + $this->output = preg_replace( "/.+?/s", "", $this->output ); + + + } + + //----------------------------------------- + // Do the edit + //----------------------------------------- + + + function do_edit() { + global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; + + if ( $ibforums->member['g_calendar_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + if ( ! $ibforums->member['id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + //----------------------------------------- + + $eventid = intval($ibforums->input['eventid']); + + if ($eventid == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + $DB->query("SELECT * FROM ibf_calendar_events WHERE eventid='$eventid'"); + + if ( ! $event = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + + $can_edit = 0; + + //----------------------------------------- + // Do we have permission to edit this event? + //----------------------------------------- + + if ($ibforums->member['id'] == $event['userid']) + { + $can_edit = 1; + } + else if ($ibforums->member['g_is_supmod'] == 1) + { + $can_edit = 1; + } + else + { + $can_edit = 0; + } + + if ($can_edit != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + // Are we deleting this event? + //----------------------------------------- + + if ($HTTP_POST_VARS['event_delete'] == 1) + { + $DB->query("DELETE FROM ibf_calendar_events WHERE eventid='$eventid'"); + + $print->redirect_screen( $ibforums->lang['delete_event_redirect'] , "&act=calendar" ); + } + else + { + + $ibforums->vars['max_post_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; + + //----------------------------------------- + // Sort out some of the form data, check for + // posting length, etc. + //----------------------------------------- + + $allow_emoticons = $ibforums->input['enableemo'] == 'yes' ? 1 : 0; + $private_event = $ibforums->input['e_type'] == 'private' ? 1 : 0; + + //----------------------------------------- + // Do we have a valid post? + //----------------------------------------- + + if (strlen( trim($HTTP_POST_VARS['Post']) ) < 1) + { + $std->Error( array( 'LEVE' => 1, 'MSG' => 'no_post') ); + } + + if (strlen( $HTTP_POST_VARS['Post'] ) > ($ibforums->vars['max_post_length']*1024)) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'post_too_long') ); + } + + //----------------------------------------- + // Fix up the Event Title + //----------------------------------------- + + $ibforums->input['event_title'] = str_replace( "
    ", "", $ibforums->input['event_title'] ); + + $ibforums->input['event_title'] = trim(stripslashes($ibforums->input['event_title'])); + + if ( (strlen($ibforums->input['event_title']) < 2) or (!$ibforums->input['event_title']) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_title_none') ); + } + + if ( strlen($ibforums->input['event_title']) > 64 ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_title_long') ); + } + + //----------------------------------------- + // Are we an admin, and have we set w/groups + // can see? + //----------------------------------------- + + $read_perms = '*'; + + if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) + { + if ( is_array( $HTTP_POST_VARS['e_groups'] ) ) + { + $read_perms = implode( ",", $HTTP_POST_VARS['e_groups'] ); + $read_perms .= ",".$ibforums->vars['admin_group']; + } + + if ($read_perms == "") + { + $read_perms = '*'; + } + + } + + $day = intval($ibforums->input['e_day']); + $month = intval($ibforums->input['e_month']); + $year = intval($ibforums->input['e_year']); + + //----------------------------------------- + // Do we have a sensible date? + //----------------------------------------- + + if ( ! checkdate( $month, $day , $year ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_date_oor') ); + } + + //----------------------------------------- + // Add it to the DB + //----------------------------------------- + + $db_string = $DB->compile_db_update_string( array ( + 'year' => $year, + 'month' => $month, + 'mday' => $day, + 'title' => $ibforums->input['event_title'], + 'event_text' => $ibforums->input['Post'], + 'read_perms' => $read_perms, + 'priv_event' => $private_event, + 'unix_stamp' => mktime( 23, 59, 59, $month, $day, $year), + 'show_emoticons' => $allow_emoticons, + ) ); + + $DB->query("UPDATE ibf_calendar_events SET $db_string WHERE eventid='$eventid'"); + + $print->redirect_screen( $ibforums->lang['edit_event_redirect'] , "&act=calendar&code=showevent&eventid=$eventid" ); + + } + } + + //----------------------------------------- + + function show_month() { + global $ibforums, $DB, $std, $print; + + //----------------------------------------- + // Get the birthdays from the database + //----------------------------------------- + + $birthdays = array(); + + $DB->query("SELECT bday_day from ibf_members WHERE bday_month='".$this->chosen_month."'"); + + while ($user = $DB->fetch_row()) + { + $birthdays[ $user['bday_day'] ]++; + } + + //----------------------------------------- + // Get the events + //----------------------------------------- + + $events = array(); + + $DB->query("SELECT eventid, title, userid, priv_event, read_perms, mday from ibf_calendar_events WHERE month='".$this->chosen_month."' AND year='".$this->chosen_year."'"); + + while ( $event = $DB->fetch_row() ) + { + if ( $event['priv_event'] == 1 ) + { + if ($ibforums->member['id'] != $event['userid']) + { + continue; + } + } + + if ( $event['read_perms'] != '*' ) + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) ) + { + continue; + } + } + + $events[ $event['mday'] ][] = $event; + } + + //----------------------------------------- + // Figure out the next / previous links + //----------------------------------------- + + $prev_month = array(); + $next_month = array(); + + $prev_month['year_id'] = $this->chosen_year; + $next_month['year_id'] = $this->chosen_year; + + $prev_month['month_id'] = $this->chosen_month - 1; + $prev_month['month_name'] = $this->month_words[$this->chosen_month - 2]; + + $next_month['month_name'] = $this->month_words[$this->chosen_month]; + $next_month['month_id'] = $this->chosen_month + 1; + + if ($this->chosen_month == 1) + { + $prev_month['month_name'] = $this->month_words[11]; + $prev_month['month_id'] = 12; + $prev_month['year_id'] = $this->chosen_year - 1; + + } + else if ($this->chosen_month == 12) + { + $next_month['month_name'] = $this->month_words[0]; + $next_month['month_id'] = 1; + $next_month['year_id'] = $this->chosen_year + 1; + } + + $this->output .= $this->html->cal_main_content($this->month_words[$this->chosen_month - 1], $this->chosen_year, $prev_month, $next_month); + + //----------------------------------------- + // Print the days table top row + //----------------------------------------- + + $day_output = ""; + $cal_output = ""; + + foreach ($this->day_words as $day) + { + $day_output .= $this->html->cal_day_bit($day); + } + + //----------------------------------------- + // Print the main calendar body + //----------------------------------------- + + for ( $c = 1 ; $c < (6*7); $c++ ) + { + $day_array = getdate($this->our_datestamp); + $day_array['wday']++; + + if ( (($c) % 7 ) == 1 ) + { + //----------------------------------------- + // Kill the loop if we are no longer on our month + //----------------------------------------- + + if ($day_array['mon'] != $this->chosen_month) + { + break; + } + + $cal_output .= $this->html->cal_new_row(); + } + + //----------------------------------------- + // Run out of legal days for this month? + //----------------------------------------- + + if ( $c < $this->first_day_array['wday'] || $day_array['mon'] != $this->chosen_month ) + { + $cal_output .= $this->html->cal_blank_cell(); + } + else + { + + $this_day_events = ""; + $cal_date = $day_array['mday']; + + $this_day_events = ""; + + if ( isset($events[ $day_array['mday'] ]) and is_array($events[ $day_array['mday'] ]) ) + { + if ( count( $events[ $day_array['mday'] ] ) > 0 ) + { + foreach( $events[ $day_array['mday'] ] as $idx => $data ) + { + $this_day_events .= $this->html->cal_events_wrap( + "code=showevent&eventid=".$data['eventid'], + $data['title'] + ); + } + } + } + + if ( isset($birthdays[ $day_array['mday'] ]) and $birthdays[ $day_array['mday'] ] > 0 ) + { + $this_day_events .= $this->html->cal_events_wrap( + "code=birthdays&y=".$this->chosen_year."&m=".$this->chosen_month."&d=".$day_array['mday'], + sprintf( $ibforums->lang['entry_birthdays'], $birthdays[ $day_array['mday'] ] ) + ); + + } + + if ($this_day_events != "") + { + $cal_date = "{$day_array['mday']}"; + + $this_day_events = $this->html->cal_events_start() . $this_day_events . $this->html->cal_events_end(); + } + + if ($day_array['mday'] == $this->now_date['mday'] and $this->now_date['mon'] == $day_array['mon']) + { + $cal_output .= $this->html->cal_date_cell_today($cal_date, $this_day_events); + } + else + { + $cal_output .= $this->html->cal_date_cell($cal_date, $this_day_events); + } + $this->our_datestamp += 86400; + } + + } + + //----------------------------------------- + // Switch the HTML tags... + //----------------------------------------- + + $this->output = str_replace( "", $day_output, $this->output ); + $this->output = str_replace( "" , $cal_output, $this->output ); + + $this->output = str_replace( "" , $this->get_month_dropdown(), $this->output ); + $this->output = str_replace( "" , $this->get_year_dropdown() , $this->output ); + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $this->month_words[$this->chosen_month - 1]." ".$this->chosen_year; + + } + + //----------------------------------------- + // POST NEW CALENDAR EVENT + //----------------------------------------- + + function new_event() { + global $ibforums, $DB, $std, $print; + + if ( $ibforums->member['g_calendar_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + if ( ! $ibforums->member['id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + $ibforums->lang['the_max_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $ibforums->lang['post_new_event']; + + $this->output .= $this->post_html->calendar_start_form(); + $this->output .= $this->post_html->table_top($ibforums->lang['post_new_event']); + $this->output .= $this->post_html->calendar_event_title(); + $this->output .= $this->post_html->calendar_choose_date( + $this->get_day_dropdown(), $this->get_month_dropdown(), $this->get_year_dropdown() + ); + + $this->output .= $this->post_html->calendar_event_type(); + + if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) + { + // Get all the group ID's and names from the DB and build the selection box + + $group_choices = ""; + + $DB->query("SELECT g_id, g_title FROM ibf_groups ORDER BY g_title"); + + while ( $r = $DB->fetch_row() ) + { + $group_choices .= "\n"; + } + + $this->output .= $this->post_html->calendar_admin_group_box($group_choices); + } + + + + $this->output .= $this->post_html->postbox_buttons(""); + + $this->output .= $this->post_html->calendar_end_form($ibforums->lang['calendar_submit']); + + + //-------------------------------------- + // Add in the smilies box + //-------------------------------------- + + $show_table = 0; + $count = 0; + $smilies = "\n"; + + // Get the smilies from the DB + + $DB->query("SELECT * FROM ibf_emoticons WHERE clickable='1'"); + + while ($elmo = $DB->fetch_row() ) + { + + $show_table++; + $count++; + + $smilies .= "vars['EMOTICONS_URL']."/".$elmo['image']."\" alt='smilie' border='0'> \n"; + + if ($count == $ibforums->vars['emo_per_row']) { + $smilies .= "\n\n"; + $count = 0; + } + } + + if ($count != $ibforums->vars['emo_per_row']) + { + for ($i = $count ; $i < $ibforums->vars['emo_per_row'] ; ++$i) { + $smilies .= " \n"; + } + $smilies .= ""; + } + + $table = $this->post_html->smilie_table(); + + if ($show_table != 0) + { + $table = preg_replace( "//", $smilies, $table ); + $this->output = preg_replace( "//", $table, $this->output ); + } + + // Remove the "add sig" box + + $this->output = preg_replace( "/.+?/s", "", $this->output ); + + + } + + + //----------------------------------------- + // ADD NEW CALENDAR EVENT TO THE DB + //----------------------------------------- + + function add_new_event() { + global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; + + if ( $ibforums->member['g_calendar_post'] != 1) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + if ( ! $ibforums->member['id']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); + } + + $ibforums->vars['max_post_length'] = $ibforums->vars['max_post_length'] ? $ibforums->vars['max_post_length'] : 2140000; + + //----------------------------------------- + // Sort out some of the form data, check for + // posting length, etc. + //----------------------------------------- + + $allow_emoticons = $ibforums->input['enableemo'] == 'yes' ? 1 : 0; + $private_event = $ibforums->input['e_type'] == 'private' ? 1 : 0; + + //----------------------------------------- + // Do we have a valid post? + //----------------------------------------- + + if (strlen( trim($HTTP_POST_VARS['Post']) ) < 1) + { + $std->Error( array( 'LEVE' => 1, 'MSG' => 'no_post') ); + } + + if (strlen( $HTTP_POST_VARS['Post'] ) > ($ibforums->vars['max_post_length']*1024)) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'post_too_long') ); + } + + //----------------------------------------- + // Fix up the Event Title + //----------------------------------------- + + $ibforums->input['event_title'] = str_replace( "
    ", "", $ibforums->input['event_title'] ); + + $ibforums->input['event_title'] = trim(stripslashes($ibforums->input['event_title'])); + + if ( (strlen($ibforums->input['event_title']) < 2) or (!$ibforums->input['event_title']) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_title_none') ); + } + + if ( strlen($ibforums->input['event_title']) > 64 ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_title_long') ); + } + + //----------------------------------------- + // Are we an admin, and have we set w/groups + // can see? + //----------------------------------------- + + $read_perms = '*'; + + if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) + { + if ( is_array( $HTTP_POST_VARS['e_groups'] ) ) + { + $read_perms = implode( ",", $HTTP_POST_VARS['e_groups'] ); + $read_perms .= ",".$ibforums->vars['admin_group']; + } + + if ($read_perms == "") + { + $read_perms = '*'; + } + + } + + $day = intval($ibforums->input['e_day']); + $month = intval($ibforums->input['e_month']); + $year = intval($ibforums->input['e_year']); + + //----------------------------------------- + // Do we have a sensible date? + //----------------------------------------- + + if ( ! checkdate( $month, $day , $year ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_date_oor') ); + } + + //----------------------------------------- + // Add it to the DB + //----------------------------------------- + + $db_string = $DB->compile_db_insert_string( array ( + 'userid' => $ibforums->member['id'], + 'year' => $year, + 'month' => $month, + 'mday' => $day, + 'title' => $ibforums->input['event_title'], + 'event_text' => $ibforums->input['Post'], + 'read_perms' => $read_perms, + 'unix_stamp' => mktime( 23, 59, 59, $month, $day, $year), + 'priv_event' => $private_event, + 'show_emoticons' => $allow_emoticons, + ) ); + + $DB->query("INSERT INTO ibf_calendar_events (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")"); + + $print->redirect_screen( $ibforums->lang['new_event_redirect'] , "&act=calendar" ); + } + + + //----------------------------------------- + // SHOW DAYS EVENTS + //----------------------------------------- + + function show_day() { + global $ibforums, $DB, $std, $print; + + $day = intval($ibforums->input['d']); + $month = intval($ibforums->input['m']); + $year = intval($ibforums->input['y']); + + //----------------------------------------- + // Do we have a sensible date? + //----------------------------------------- + + if ( ! checkdate( $month, $day , $year ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_date_oor') ); + } + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + //----------------------------------------- + + $this->output .= $this->html->cal_page_events_start(); + + $eq = $DB->query("SELECT * FROM ibf_calendar_events WHERE month='$month' AND mday='$day' AND year='$year'"); + + $printed = 0; + + if ( $DB->get_num_rows($eq) ) + { + while ( $event = $DB->fetch_row($eq) ) + { + //----------------------------------------- + // Is it a private event? + //----------------------------------------- + + if ($event['priv_event'] == 1 and $ibforums->member['id'] != $event['userid']) + { + continue; + } + + //----------------------------------------- + // Do we have permission to see the event? + //----------------------------------------- + + if ( $event['read_perms'] != '*' ) + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) ) + { + continue; + } + } + + $this->output .= $this->make_event_html($event); + + $printed++; + } + } + + //----------------------------------------- + // Do we have any printed events? + //----------------------------------------- + + if ($printed > 0) + { + $switch = 1; + } + else + { + // Error if no birthdays + $switch = 0; + } + + $this->output .= $this->make_birthday_html($month, $day, $switch); + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $day." ".$this->month_words[$this->chosen_month - 1]." ".$this->chosen_year; + + } + + + //----------------------------------------- + // SHOW A SINGLE EVENT BASED ON eventid + //----------------------------------------- + + function show_event() { + global $ibforums, $DB, $std, $print; + + $eventid = intval($ibforums->input['eventid']); + + if ($eventid == "") + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + $DB->query("SELECT * FROM ibf_calendar_events WHERE eventid='$eventid'"); + + if ( ! $event = $DB->fetch_row() ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + // Is it a private event? + //----------------------------------------- + + if ($event['priv_event'] == 1 and $ibforums->member['id'] != $event['userid']) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + + //----------------------------------------- + // Do we have permission to see the event? + //----------------------------------------- + + if ( $event['read_perms'] != '*' ) + { + if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + } + + //----------------------------------------- + // Get the pre parsed event HTML + //----------------------------------------- + + require "./sources/lib/post_parser.php"; + + $this->parser = new post_parser(); + + //----------------------------------------- + + $this->output .= $this->html->cal_page_events_start() . $this->make_event_html($event); + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $event['title']; + + } + + //----------------------------------------- + // MAKE EVENT HTML (return HTML for bdays) + //----------------------------------------- + + function make_event_html($event) { + global $ibforums, $DB, $std, $print; + + //----------------------------------------- + // Parse the text + //----------------------------------------- + + $event['event_text'] = $this->parser->convert( array( 'TEXT' => $event['event_text'], + 'SMILIES' => $event['show_emoticons'], + 'CODE' => 1, + 'HTML' => 0 + ) ); + + //----------------------------------------- + // What kind of event is it? + //----------------------------------------- + + $event_type = $ibforums->lang['public_event']; + + if ($event['priv_event'] == 1) + { + $event_type = $ibforums->lang['private_event']; + } + else if ($event['read_perms'] != '*') + { + $event_type = $ibforums->lang['restricted_event']; + } + + //----------------------------------------- + // Do we have an edit button? + //----------------------------------------- + + $edit_button = ""; + + // Are we a super dooper moderator? + + if ($ibforums->member['g_is_supmod'] == 1) + { + $edit_button = $this->html->cal_edit_button($event['eventid']); + } + + // Are we the OP of this event? + + else if ($ibforums->member['id'] == $event['userid']) + { + $edit_button = $this->html->cal_edit_button($event['eventid']); + } + + //----------------------------------------- + // Get the member details and stuff + //----------------------------------------- + + $DB->query("SELECT m.id, m.name, m.mgroup, m.posts, m.joined, m.avatar, m.avatar_size, ". + "g.g_id, g.g_title FROM ibf_members m, ibf_groups g WHERE m.id='".$event['userid']."' AND g.g_id=m.mgroup"); + + $member = $DB->fetch_row(); + + $member['joined'] = $std->get_date( $member['joined'], 'JOINED' ); + + $member['avatar'] = $std->get_avatar( $member['avatar'], $ibforums->member['view_avs'], $member['avatar_size']); + + $event['month_text'] = $this->month_words[$event['month'] - 1]; + + return $this->html->cal_show_event($event, $member, $event_type, $edit_button ); + + } + + //----------------------------------------- + // SHOW BIRTHDAYS + //----------------------------------------- + + function show_birthdays() { + global $ibforums, $DB, $std, $print; + + $day = intval($ibforums->input['d']); + $month = intval($ibforums->input['m']); + $year = intval($ibforums->input['y']); + + //----------------------------------------- + // Do we have a sensible date? + //----------------------------------------- + + if ( ! checkdate( $month, $day , $year ) ) + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_date_oor') ); + } + + $this->output .= $this->html->cal_page_events_start() . $this->make_birthday_html($month, $day); + + $this->nav[] = "{$ibforums->lang['page_title']}"; + $this->nav[] = $ibforums->lang['cal_birthdays']." ".$this->month_words[$this->chosen_month - 1]." ".$this->chosen_year; + + } + + //----------------------------------------- + // MAKE BIRTHDAY HTML (return HTML for bdays) + //----------------------------------------- + + function make_birthday_html($month, $day, $switch=0) { + global $ibforums, $DB, $std, $print; + + //----------------------------------------- + // Get the birthdays from the database + //----------------------------------------- + + $birthdays = array(); + + $output = ""; + + $DB->query("SELECT id, name, bday_year from ibf_members WHERE bday_month='".$month."' and bday_day='$day'"); + + if ( ! $DB->get_num_rows() ) + { + if ($switch == 1) + { + return; + } + else + { + $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cal_no_events') ); + } + } + else + { + $output .= $this->html->cal_birthday_start(); + + while ( $r = $DB->fetch_row() ) + { + $age = $this->chosen_year - $r['bday_year']; + + $output .= $this->html->cal_birthday_entry($r['id'], $r['name'], $age); + } + + $output .= $this->html->cal_birthday_end(); + } + + return $output; + } + + + + + //----------------------------------------- + + function get_month_dropdown($month="") + { + global $ibforums; + + $return = ""; + + if ($month == "") + { + $month = $this->chosen_month; + } + + for ( $x = 1 ; $x <= 12 ; $x++ ) + { + $return .= "\t
    "; - } - - return $the_html; - - } - - function clean_email($email = "") { - - $email = preg_replace( "#[\n\r\*\'\"<>&\%\!\(\)\{\}\[\]\?\\/]#", "", $email ); - - if ( preg_match( "/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,4})(\]?)$/", $email) ) - { - return $email; - } - else - { - return FALSE; - } - } - - - /*-------------------------------------------------------------------------*/ - // SKIN, sort out the skin stuff - /*-------------------------------------------------------------------------*/ - - function load_skin() { - global $ibforums, $INFO, $DB; - - $id = -1; - $skin_set = 0; - - //------------------------------------------------ - // Do we have a skin for a particular forum? - //------------------------------------------------ - - if ($ibforums->input['f'] and $ibforums->input['act'] != 'UserCP') - { - if ( $ibforums->vars[ 'forum_skin_'.$ibforums->input['f'] ] != "" ) - { - $id = $ibforums->vars[ 'forum_skin_'.$ibforums->input['f'] ]; - - $skin_set = 1; - } - } - - //------------------------------------------------ - // Are we allowing user chooseable skins? - //------------------------------------------------ - - $extra = ""; - - if ($skin_set != 1 and $ibforums->vars['allow_skins'] == 1) - { - if (isset($ibforums->input['skinid'])) - { - $id = $ibforums->input['skinid']; - $extra = " AND s.hidden=0"; - $skin_set = 1; - } - else if ( $ibforums->member['skin'] != "" and intval($ibforums->member['skin']) >= 0 ) - { - $id = $ibforums->member['skin']; - - if ($id == 'Default') $id = -1; - - $skin_set = 1; - } - - } - - //------------------------------------------------ - // Load the info from the database. - //------------------------------------------------ - - if ( $id >= 0 and $skin_set == 1) - { - - $DB->query("SELECT s.*, i.*, t.template FROM ibf_templates t, ibf_skins s, ibf_images i ". - "WHERE s.sid='$id' AND t.tmid=s.tmpl_id AND i.imid=s.img_id".$extra); - - // Didn't get a row? - - if (! $DB->get_num_rows() ) - { - // Update this members profile - - if ( $ibforums->member['id'] ) - { - $DB->query("UPDATE ibf_members SET skin='-1' WHERE id='".$ibforums->member['id']."'"); - } - - $DB->query("SELECT s.*, i.*, t.template FROM ibf_templates t, ibf_skins s, ibf_images i ". - "WHERE s.default_set=1 AND t.tmid=s.tmpl_id AND i.imid=s.img_id"); - } - - } - else - { - $DB->query("SELECT s.*, i.*, t.template FROM ibf_templates t, ibf_skins s, ibf_images i ". - "WHERE s.default_set=1 AND t.tmid=s.tmpl_id AND i.imid=s.img_id"); - } - - if ( ! $row = $DB->fetch_row() ) - { - echo("Could not query the skin information!"); - exit(); - } - - return $row; - - } - - /*-------------------------------------------------------------------------*/ - // Require, parse and return an array containing the language stuff - /*-------------------------------------------------------------------------*/ - - function load_words($current_lang_array, $area, $lang_type) { - - require "./lang/".$lang_type."/".$area.".php"; - - foreach ($lang as $k => $v) - { - $current_lang_array[$k] = stripslashes($v); - } - - unset($lang); - - return $current_lang_array; - - } - - - /*-------------------------------------------------------------------------*/ - // Return a date or '--' if the date is undef. - // We use the rather nice gmdate function in PHP to synchronise our times - // with GMT. This gives us the following choices: - // - // If the user has specified a time offset, we use that. If they haven't set - // a time zone, we use the default board time offset (which should automagically - // be adjusted to match gmdate. - /*-------------------------------------------------------------------------*/ - - function get_date($date, $method) { - global $ibforums; - - if (!$date) - { - return '--'; - } - - if (empty($method)) - { - $method = 'LONG'; - } - - if ($this->offset_set == 0) - { - // Save redoing this code for each call, only do once per page load - - $this->offset = (($ibforums->member['time_offset'] != "") ? $ibforums->member['time_offset'] : $ibforums->vars['time_offset']) * 3600; - - if ($ibforums->vars['time_adjust'] != "" and $ibforums->vars['time_adjust'] != 0) - { - $this->offset += ($ibforums->vars['time_adjust'] * 60); - } - - if ($ibforums->member['dst_in_use']) - { - $this->offset += 3600; - } - - $this->offset_set = 1; - } - - - return gmdate($this->time_options[$method], ($date + $this->offset) ); - } - - /*-------------------------------------------------------------------------*/ - // Sets a cookie, abstract layer allows us to do some checking, etc - /*-------------------------------------------------------------------------*/ - - function my_setcookie($name, $value = "", $sticky = 1) { - global $INFO; - - $exipres = ""; - - if ($sticky == 1) - { - $expires = time() + 60*60*24*365; - } - - $INFO['cookie_domain'] = $INFO['cookie_domain'] == "" ? "" : $INFO['cookie_domain']; - $INFO['cookie_path'] = $INFO['cookie_path'] == "" ? "/" : $INFO['cookie_path']; - - $name = $INFO['cookie_id'].$name; - - @setcookie($name, urlencode($value), $expires, $INFO['cookie_path'], $INFO['cookie_domain']); - } - - /*-------------------------------------------------------------------------*/ - // Cookies, cookies everywhere and not a byte to eat. - /*-------------------------------------------------------------------------*/ - - function my_getcookie($name) - { - global $INFO, $HTTP_COOKIE_VARS; - - if (isset($HTTP_COOKIE_VARS[$INFO['cookie_id'].$name])) - { - return urldecode($HTTP_COOKIE_VARS[$INFO['cookie_id'].$name]); - } - else - { - return FALSE; - } - - } - - /*-------------------------------------------------------------------------*/ - // Makes incoming info "safe" - /*-------------------------------------------------------------------------*/ - - function parse_incoming() - { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR; - $return = array(); - - if( is_array($HTTP_GET_VARS) ) - { - while( list($k, $v) = each($HTTP_GET_VARS) ) - { - //$k = $this->clean_key($k); - if( is_array($HTTP_GET_VARS[$k]) ) - { - while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) - { - $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); - } - } - else - { - $return[$k] = $this->clean_value($v); - } - } - } - - // Overwrite GET data with post data - - if( is_array($HTTP_POST_VARS) ) - { - while( list($k, $v) = each($HTTP_POST_VARS) ) - { - //$k = $this->clean_key($k); - if ( is_array($HTTP_POST_VARS[$k]) ) - { - while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) - { - $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); - } - } - else - { - $return[$k] = $this->clean_value($v); - } - } - } - - // Sort out the accessing IP - - $return['IP_ADDRESS'] = $this->select_var( array( - 1 => $HTTP_X_FORWARDED_FOR, - 2 => $HTTP_PROXY_USER, - 3 => $REMOTE_ADDR, - 4 => $_SERVER['REMOTE_ADDR'] - ) - ); - - // Make sure we take a valid IP address - - $return['IP_ADDRESS'] = preg_replace( "/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/", "\\1.\\2.\\3.\\4", $return['IP_ADDRESS'] ); - - $return['request_method'] = strtolower($REQUEST_METHOD); - - - return $return; - } - - /*-------------------------------------------------------------------------*/ - // Key Cleaner - ensures no funny business with form elements - /*-------------------------------------------------------------------------*/ - - function clean_key($key) { - - if ($key == "") - { - return ""; - } - $key = preg_replace( "/\.\./" , "" , $key ); - $key = preg_replace( "/\_\_(.+?)\_\_/" , "" , $key ); - $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key ); - return $key; - } - - function clean_value($val) { - - if ($val == "") - { - return ""; - } - $val = preg_replace( "/&/" , "&" , $val ); - $val = preg_replace( "//" , "-->" , $val ); - $val = preg_replace( "/ - - - - - -
    - - - - - -
    {ibf.lang.menu}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.display}
    - {ibf.lang.a_topic_results}
    - {ibf.lang.a_topic_d_delete} {$data[delete]}

    -
    -
    - - - - - - - - - {ibf.lang.q_topics} $count - - - - - - - - - - {ibf.lang.menu_off} - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/ReportView.html b/upload/style_templates/1/ReportView.html deleted file mode 100644 index a751256a..00000000 --- a/upload/style_templates/1/ReportView.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - {ibf.lang.message}

    {ibf.lang.warn} - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/config.php b/upload/style_templates/1/config.php deleted file mode 100644 index da7dd9d0..00000000 --- a/upload/style_templates/1/config.php +++ /dev/null @@ -1,247 +0,0 @@ - \ No newline at end of file diff --git a/upload/style_templates/1/skin_boards.html b/upload/style_templates/1/skin_boards.html deleted file mode 100644 index e18dff57..00000000 --- a/upload/style_templates/1/skin_boards.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - -
    -
    - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.title}
    {ibf.lang.in_forum}{$data[FORUM]}->{'FORUM_NAME'}
    {ibf.lang.in_topic}{$data[TOPIC]}->{'TOPIC_TITLE'}
    - - - -
    - - - - - - - - - - - - -
    {ibf.lang.email_sent}
    {ibf.lang.email_sent}
    {ibf.lang.email_sent_txt} $member_name
    -
    - - - - - - - -
    {ibf.lang.name}
    {ibf.lang.email}
    - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.board_stats}
    $active[TOTAL] {ibf.lang.active_users}
    {ibf.skin.F_ACTIVE}{$active[GUESTS]} {ibf.lang.guests}, $active[MEMBERS] {ibf.lang.public_members} $active[ANON] {ibf.lang.anon_members} {$active[LINK]}
    {$active[NAMES]}
    {ibf.lang.board_stats}
    {ibf.skin.F_STATS}$text
    {ibf.lang.most_online}
    {ibf.lang.birthday_header}
    {ibf.skin.F_ACTIVE}$total $birth_lang
    $birthusers
    -
    - -
    - - - - - - - - -
    - - - - -
    [ {ibf.lang.d_delete_cookies} ] :: [ {ibf.lang.d_post_read} ]
    - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_emails.html b/upload/style_templates/1/skin_emails.html deleted file mode 100644 index 74822556..00000000 --- a/upload/style_templates/1/skin_emails.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    {ibf.skin.CAT_IMG}{$Data['name']}
    -
    - - - - - - - - - - - - - - - -
    {ibf.lang.cat_name}{ibf.lang.topics}{ibf.lang.replies}{ibf.lang.last_post_info}
    - - - -
    - - - - - - - - - - - - - - - - - - -
    {ibf.lang.cat_name}{ibf.lang.topics}{ibf.lang.replies}{ibf.lang.last_post_info}
     
    -
    -
    - - - - - - - - - - - - - - - -{ibf.vars.board_name} {ibf.lang.newslink} $title
    - - - - - - - - - - - - -
    {ibf.lang.welcome_back_text} $lastvisit - {ibf.lang.sm_forum_leaders} | - {ibf.lang.sm_todays_posts}
    - {ibf.lang.sm_today_posters} | - {ibf.lang.sm_all_posters} -
    - - - - - - - - -
    {$info['img_new_post']}{$info['name']}
    {$info['description']}
    {$info['moderator']}
    {$info['topics']}{$info['posts']}{$info['last_post']}
    {ibf.lang.in}: {$info['last_topic']}
    {ibf.lang.by}: {$info['last_poster']}
    {ibf.lang.name}
    {ibf.lang.email}
    {ibf.lang.msg}
    - - - -   - - - - - - - - - - - -
    - - - - - - - - - - - -
    {$data[TITLE]}
    -
    Download AIMAIM Remote
    Send me an Instant Message
    Add me to Your Buddy List
    Add Remote to Your Page
    Download AOL Instant Messenger

    - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.title}
    {ibf.lang.send_lang}$lang
    {ibf.lang.to_name}
    {ibf.lang.to_email}
    {ibf.lang.subject}
    {ibf.lang.message} -
    - -
    -
    -
    - - - - - - - - - - - -
    - - - - - - - - - -
    {ibf.lang.send_email_to} {$data[NAME]}
    {ibf.lang.show_address_text}
    >>{ibf.lang.send_email_to} {$data[NAME]}
    -
    - - - - - - - -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    {ibf.lang.send_title}
    {ibf.lang.send_email_to} {$data[NAME]}
    {ibf.lang.subject} -
    {ibf.lang.message}

    {ibf.lang.msg_txt}
    -
    - -
    -
    -
    - - - - - - - - - - - -
    - - - - - - - - -
    {ibf.lang.email_sent}
    {ibf.lang.email_sent_txt} $member_name
    -
    - - - - - - - - - - - -
    $data
    - - - - diff --git a/upload/style_templates/1/skin_forum.html b/upload/style_templates/1/skin_forum.html deleted file mode 100644 index 025df849..00000000 --- a/upload/style_templates/1/skin_forum.html +++ /dev/null @@ -1,281 +0,0 @@ - - - -
    - - - - - - - - -
    - - - - - - - - - - - - - - -
    {ibf.lang.need_password}
    {ibf.lang.need_password_txt}
    {ibf.lang.enter_pass}
    -
    -
    - - - - - - - -
    - - - - -
    {ibf.lang.mod_cp}
    - - - - - - - - -
    - - - - -
    {$rules['title']}

    {$rules['body']}
    -
    - - - - - - - - - -
    - - - - -
    >>{$rules['title']}
    -
    - - - - - - - - -
    - - - - - - - - -
    - - - - - -
    {ibf.lang.showing_text}{ibf.lang.sort_text} 
    -
    - - - - - - - - - -
    {$Data[SHOW_PAGES]}{ibf.skin.A_POST}{$Data[POLL_BUTTON]}
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.skin.B_NEW}{ibf.lang.pm_open_new} {ibf.skin.B_POLL}{ibf.lang.pm_poll}  - - - - - - - - - - - - -
    {ibf.lang.search_forum} 
    -
    - {$Data[FORUM_JUMP]} -
    {ibf.skin.B_NORM}{ibf.lang.pm_open_no} {ibf.skin.B_POLL_NN}{ibf.lang.pm_poll_no} 
    {ibf.skin.B_HOT}{ibf.lang.pm_hot_new} {ibf.skin.B_LOCKED}{ibf.lang.pm_locked} 
    {ibf.skin.B_HOT_NN}{ibf.lang.pm_hot_no} {ibf.skin.B_MOVED}{ibf.lang.pm_moved} 
    - - - - - - - - -
    - - - - -
    - - - - - - - - - - -
    {$rules['title']}
    {$rules['body']}
    >>{ibf.lang.back_to_forum}
    -
    -
    - - - - - - - - - - - - -
    $title$pages
    - - - - - - - - - - - - - -
    {$info['SHOW_PAGES']}{ibf.skin.A_POST}{$info[POLL_BUTTON]}
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    {$info['name']}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_global.html b/upload/style_templates/1/skin_global.html deleted file mode 100644 index 54a82111..00000000 --- a/upload/style_templates/1/skin_global.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - {ibf.lang.logged_in_as} {ibf.member.name} ( {ibf.lang.your_cp} | {ibf.lang.log_out} | {$msg[TEXT]} ) - - - - - - - - -
    - - - - - - - {ibf.lang.h_topic_title} ( {ibf.lang.mark_as_read} ){ibf.lang.h_topic_starter}{ibf.lang.h_replies}{ibf.lang.h_hits}{ibf.lang.h_last_action}
    -
    - {ibf.lang.no_topics} -

    -
    {$Data['folder_img']}{$Data['topic_icon']} - - - - - -
    {$Data['go_new_post']}{$Data['prefix']} {$Data['title']} {$Data[PAGES]}
    - {$Data['description']}
    {$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    {$Data['last_text']} {$Data['last_poster']}
    - - - - - - - -
    Powered by IBForums
    - - - - - -
    - <% MEMBER BAR %> - Search | Member List | Help
    -
    -
    - - - - - - - - - - - - -
    {ibf.skin.F_NAV}
    - - - - - - - - - -{ibf.lang.stand_by} - - - - - - - - - -
    - - - - -
    - - - - -
    - {ibf.lang.thanks}, - $Text

    - {ibf.lang.transfer_you}

    - ({ibf.lang.dont_wait})
    -
    -
    - - - - - - - - - - - - - - - - - - {ibf.lang.guest_stuff} ( {ibf.lang.log_in} | {ibf.lang.register} ) - - - - - - - -( {ibf.lang.admin_cp} ) - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    {ibf.lang.er_log_in_title}
    {ibf.lang.erl_enter_name}
    {ibf.lang.erl_enter_pass}
    - -
    -
    - - - - - - - - - - - - - - - -
    - - - - - -
    {ibf.lang.offline_title}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -

    $message

    {ibf.lang.offline_login}
    {ibf.lang.erl_enter_name}
    {ibf.lang.erl_enter_pass}
    - - - - - - - - - - - - - - - - -
    - - - - - -
    {ibf.lang.error_title}
    -
    - - - - - - - -
    - {ibf.lang.exp_text}

    - {ibf.lang.msg_head} -

    - $message -

    - -

    - Useful Links: -

    - • {ibf.lang.er_lost_pass}
    - • {ibf.lang.er_register}
    - • {ibf.lang.er_help_files}
    - • {ibf.lang.er_contact_admin}

    -
    < {ibf.lang.error_back}
    -
    - - - - - - - - {ibf.lang.logged_in_as} {ibf.member.name} ( {ibf.lang.your_cp} | {ibf.lang.log_out} ) - - - - diff --git a/upload/style_templates/1/skin_help.html b/upload/style_templates/1/skin_help.html deleted file mode 100644 index 68af020c..00000000 --- a/upload/style_templates/1/skin_help.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - -
    {$entry['title']}
    {$entry['description']}
    $text
    - - - - - - - - - - - - {ibf.lang.no_results} - - - - - - - - - - -
    $two_text
    - - - - - -
    - - - - - - - -
    $one_text
    -
    - - - - {ibf.lang.search_txt}    -
    -
    -
    -
    - - - - -
    - - - - - - - - diff --git a/upload/style_templates/1/skin_legends.html b/upload/style_templates/1/skin_legends.html deleted file mode 100644 index 9f9ee8ba..00000000 --- a/upload/style_templates/1/skin_legends.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - -
    $three_text
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    $title
    $row1$row2
    $code$image
    -
    - - - - - diff --git a/upload/style_templates/1/skin_login.html b/upload/style_templates/1/skin_login.html deleted file mode 100644 index dea7bb98..00000000 --- a/upload/style_templates/1/skin_login.html +++ /dev/null @@ -1,126 +0,0 @@ - - - -
    -
    - - - - - -
    - - - - - - - - -
    {ibf.lang.log_out}

    {ibf.lang.log_out_txt}
    - -
    -
    -
    - - - - - - - - - - - -
    - - - - -
    {ibf.lang.errors_found}
    $data
    -
    -
    - - - - - - - - -
    - - - - - - - -
    {ibf.lang.login_text}
    {ibf.lang.forgot_pass} {ibf.lang.pass_link}
    -
    - - - - - - - - -
    - - - - - - - - - - - - -
    $message
    {ibf.lang.enter_name}
    {ibf.lang.enter_pass}
    -
    -
    - - -
    - - - - - - - - - - - - - -
    {ibf.lang.options}
    {ibf.lang.cookies}{ibf.lang.cookie_yes}
    {ibf.lang.cookie_no}
    {ibf.lang.privacy}{ibf.lang.anon_name}
    - -
    -
    -
    - - - - diff --git a/upload/style_templates/1/skin_mlist.html b/upload/style_templates/1/skin_mlist.html deleted file mode 100644 index dc4ac41a..00000000 --- a/upload/style_templates/1/skin_mlist.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - -
    {$links[SHOW_PAGES]}
    - - - - - - - - - - -
    -   -
    - - - - - - - - - - - - - - - - - - -
    {ibf.lang.member_name}{ibf.lang.member_level}{ibf.lang.member_group}{ibf.lang.member_joined}{ibf.lang.member_posts}{ibf.lang.member_email}{ibf.lang.member_aol}{ibf.lang.member_icq}
    - - - -
    {$links[SHOW_PAGES]}
    - - - - - - - -No results - - - - - - - - - - - - - - - - - -
    - - -
    {ibf.lang.sorting_text} 
    -
    - - - - - - - - - - {$member[MEMBER_NAME]} - {$member[MEMBER_PIPS_IMG]} - {$member[MEMBER_GROUP]} - {$member[MEMBER_JOINED]} - {$member[MEMBER_POSTS]} - {$member[MEMBER_EMAIL]} - {$member[AOLNAME]} - {$member[ICQNUMBER]} - - - - - - diff --git a/upload/style_templates/1/skin_mod.html b/upload/style_templates/1/skin_mod.html deleted file mode 100644 index 3dd58fed..00000000 --- a/upload/style_templates/1/skin_mod.html +++ /dev/null @@ -1,669 +0,0 @@ - - - - -
    - - - - - - - - - - - - - -
    {ibf.lang.cp_mod_posts_title2} $forumname -
    $pages -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    $title
    - - - - - - - -
    {ibf.lang.cp_mod_posts_title2} $forumname -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.cp_3_title}{ibf.lang.cp_3_replies}{ibf.lang.cp_3_approveall}{ibf.lang.cp_3_viewall}
    $title$replies{ibf.lang.cp_3_approveall}{ibf.lang.cp_3_viewall}
    -
    -
    - - - - - - - - - - - - - - - - -
    {ibf.lang.cp_mod_topics_title2} $forumname -
    $pages -
      {ibf.lang.cp_1_selected}  
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       $title
    {$data['member']['name']}

    {$data['member']['avatar']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    - {ibf.lang.posted_on} {$data['msg']['post_date']}

    - - {$data['msg']['post']} - -
      {ibf.lang.cp_3_postno} $pid
    -
    -   -
    - - - - - - - -
    {ibf.lang.cp_results} -
    $text
    -
    - - - - - - - - - - - - - - - -
    {ibf.lang.cp_check_result} -
    {ibf.lang.cp_check_text} -
    {ibf.lang.cp_total_topics}$tcount
    {ibf.lang.cp_total_match}$count
    $link_text
    -
    {ibf.lang.cp_prune} {$forum['name']}
    {ibf.lang.cp_prune_text}
    {ibf.lang.cp_action}
    {ibf.lang.cp_prune_days}
    {ibf.lang.cp_prune_type}$select
    {ibf.lang.cp_prune_replies}
    {ibf.lang.cp_prune_member}
    {ibf.lang.cp_edit_user}: {$profile['name']}
    {ibf.lang.cp_remove_av}
    {ibf.lang.cp_edit_website}
    {ibf.lang.cp_edit_location}
    {ibf.lang.cp_edit_interests}
    {ibf.lang.cp_edit_signature}
    {ibf.lang.cp_edit_user}
    {ibf.lang.cp_find_2_user}$select
    {ibf.lang.cp_edit_user}
    {ibf.lang.cp_find_user}
    {ibf.lang.cp_welcome}
    {ibf.lang.cp_welcome_text}
    - - - - - - - - - - - - - -
    {ibf.lang.cp_mod_in}$forum
    {ibf.lang.cp_topics_wait}$tcount
    {ibf.lang.cp_posts_wait}$pcount
    -
    $words
    - -
    -
    - - - - - - - - - - - - - - {ibf.lang.move_from} $forum_name {ibf.lang.to}: - - - - {ibf.lang.leave_link} - - - - - - - - - - - - - - - - - - - - - - - - - - - {ibf.lang.edit_f_title} - - - - {ibf.lang.edit_f_desc} - - - - - - - - - - - - - - {ibf.lang.pe_option} $id - - - - - - - - - - - - - {ibf.lang.pe_pollonly} $id - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_msg.html b/upload/style_templates/1/skin_msg.html deleted file mode 100644 index 67220760..00000000 --- a/upload/style_templates/1/skin_msg.html +++ /dev/null @@ -1,536 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    -
    $posting_title
    - - - -
    {$data}
    -
    - - - - - - - - -
    - - -
    - - - - - - - - -
      
    - - - - - - - - - - - - -
    {ibf.lang.cp_mod_topics_title}
    {ibf.lang.cp_mod_topics}
    {ibf.lang.cp_mod_posts}
    - - - -
    - - - - - - - - -
    {ibf.lang.cp_manage_posts}
    {ibf.lang.cp_prune_posts}
    - - - -
    - - - - - - - - -
    {ibf.lang.cp_mod_users_title}
    {ibf.lang.cp_user_edit}
    - -
    - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - -
    {ibf.lang.cp_error}
    $msg
    - - - - -
    - - - - - - - -
    {ibf.lang.pm_preview}
    $data
    -
    -
    - - - - - - - - - -
    {ibf.lang.pmp_title}
    $text
    {ibf.lang.pmp_go_inbox} ( {ibf.lang.pmp_thiswindow} )

    {ibf.lang.pmp_ignore}
    - - - - - - - - - - Private Message Archive - - - - - - - - - - - - - -
    - - - - - - - - - - -
    {$info['msg_title']}
    {$info['msg_content']}
    Sent by {$info['msg_sender']} on {$info['msg_date']}
    -
    -
    - - - - - - - - - - - - - - - - - {ibf.lang.arc_comp_title}
    {ibf.lang.arc_complete} - - - - - - - - - {ibf.lang.archive_title}
    {ibf.lang.archive_text} - - - -
    - - - - - - - {ibf.lang.arc_folders} - $jump_html - - - {ibf.lang.arc_dateline} -   {ibf.lang.arc_days} - - - {ibf.lang.arc_max} - - - - {ibf.lang.arc_delete} - - - - {ibf.lang.arc_type} - - - - - -
    - - - - - - - - - {ibf.lang.inbox_no_msg} - - - - - - - - - - {ibf.lang.prefs_new} - - - {ibf.lang.prefs_text_b} - - - - - - - - - - - - - - - - - {ibf.lang.address_current} - - - - - - - - - - {ibf.lang.address_none} - - - - - - - - - {ibf.lang.member_edit} - - - - - - - - - - - - - - - - - - -
    {$data[MEMBER]['contact_name']}{ibf.lang.enter_desc}
    {ibf.lang.allow_msg}
    {$data[SELECT]}
    - - - - - - - - - - - {$entry['contact_name']}    [ {$entry['contact_desc']} ] - - [ {ibf.lang.edit} ] :: [ {ibf.lang.delete} ] -   ( {$entry['text']} ) - - - - - - - - - - - {ibf.lang.member_add} - - - - - - - - - - - - - - - - - -
    {ibf.lang.enter_a_name}
    {ibf.lang.enter_desc}
    {ibf.lang.allow_msg}
    - - - - - - - - - - - - - - - - - - - - - {$data[EXTRA]} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_online.html b/upload/style_templates/1/skin_online.html deleted file mode 100644 index be78f1a0..00000000 --- a/upload/style_templates/1/skin_online.html +++ /dev/null @@ -1,93 +0,0 @@ - - - -
    -
    {ibf.lang.member_name}{ibf.lang.enter_block}
    {$data['msg']['title']}
    {$data['msg']['msg_date']}
    - {ibf.skin.M_REPLY} -   - {ibf.skin.M_ADDMEM} -   - {ibf.skin.M_DELETE} -
    - - - - - - - - - - - - -
    {ibf.lang.author}{ibf.lang.m_pmessage}
    {$data['member']['name']}
    {$data['member']['avatar']}
    {$data['member']['title']}
    {$data['member']['MEMBER_GROUP']}
    {$data['member']['MEMBER_POSTS']}
    {$data['member']['MEMBER_JOINED']}
    - - {$data['msg']['message']} - {$data['member']['signature']} - -
    {$data['member']['MESSAGE_ICON']}{$data['member']['EMAIL_ICON']}{$data['member']['WEBSITE_ICON']}{$data['member']['ICQ_ICON']}{$data['member']['AOL_ICON']}{$data['member']['YAHOO_ICON']}
    -
    -
    - - - - {ibf.lang.goto_folder}:  {$data['jump']} - - -
    $dirname
    {ibf.lang.total_messages}: {$info['total_messages']} {$info['full_percent']}
    {ibf.lang.messages_left} {$info['space_free']} {$info['full_messenger']}
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     {ibf.lang.message_title}{ibf.lang.message_from}{ibf.lang.message_date}
    {$data['msg']['icon']}{$data['msg']['title']}{$data['msg']['from_name']} {$data['msg']['add_to_contacts']}{$data['msg']['date']}
    - $vdi_html {ibf.lang.move_or_delete} {ibf.lang.selected_msg} -
    - -
    - {ibf.skin.M_READ} {ibf.lang.icon_read} -  {ibf.skin.M_UNREAD} {ibf.lang.icon_unread} - -
    - - - - {ibf.lang.goto_folder}:   $vdi_html - -
    -
    {ibf.lang.msg_options}
      -  {ibf.lang.auto_sent_add} -
     {ibf.lang.read_rec_notify} -
    - - -
    {ibf.lang.to_whom}
    {ibf.lang.address_list}{$data[CONTACTS]}
    {ibf.lang.enter_name}
    {ibf.lang.enter_message}
    {ibf.lang.msg_title}
    {ibf.lang.prefs_current}
    {ibf.lang.prefs_text_a}
    - - - -
    {$links[SHOW_PAGES]}
    - - - - - - - - - - {$session['member_name']} - {$session['where_line']} - {$session['running_time']} - {$session['msg_icon']} - - - - - - - - - - - -   - - - - - -
    - - - - -
    $links
    - - - - - - - - - - - - - - -
    $links
    -
    - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_post.html b/upload/style_templates/1/skin_post.html deleted file mode 100644 index 1fb2dc9f..00000000 --- a/upload/style_templates/1/skin_post.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_poll.html b/upload/style_templates/1/skin_poll.html deleted file mode 100644 index e059a816..00000000 --- a/upload/style_templates/1/skin_poll.html +++ /dev/null @@ -1,74 +0,0 @@ - - - -[ {ibf.lang.ba_edit} ] - - - - - - - -[ {ibf.lang.ba_delete} ] - - - - - - - - - - - - - - - - - - - - - -
    -
    {ibf.lang.member_name}{ibf.lang.where}{ibf.lang.time} 
     $answer
    - -
    - - - - - - - - - - - - - - - - -
    $edit   $delete
    {ibf.lang.poll_s_choices}{ibf.lang.poll_s_votes}{ibf.lang.poll_s_stats}
    - $vote_button -
    -
    - - - - - - - - -
    $answer$votes [$percentage%]
    - - - - - - - -
    -   -
    - - - - - - - - - - - - - - -
    $data
      -
    -
    - - - - - - - - - - - - - - - -
    {ibf.lang.click_smilie}
    {ibf.lang.all_emoticons}
    - - - - - - - - - - {ibf.lang.review_topic} - - - - - - - - - - - - - - - {ibf.lang.post_icon} - -                                    
    -                                     -
    -   [ Use None ] - - - - - - - - - - - - - -
    - - - - -
    {ibf.lang.errors_found}
    $data
    -
    -
    - - - - - - - - - {ibf.lang.upload_title} - - - {ibf.lang.upload_text} $data - - - - - - - - - - - {ibf.lang.tt_topic_settings} - - - {ibf.lang.topic_title} - - - - {ibf.lang.topic_desc} - - - - - - - - - - - {$data['author']} - {ibf.lang.posted_on} {$data['date']}
    {$data['post']} - - - - - - - - - - - - -
    - - - - -
    {ibf.lang.post_preview}
    $data
    -
    -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_printpage.html b/upload/style_templates/1/skin_printpage.html deleted file mode 100644 index ba2d4706..00000000 --- a/upload/style_templates/1/skin_printpage.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - {ibf.lang.by}: {$entry['author_name']} {$this->class['LANG']['on']} {$entry['post_date']} -

    - {$entry['post']} -
    - - - - - - - - {ibf.lang.end} - - -
    {ibf.lang.last_posts}
    {ibf.lang.tt_options}
    {ibf.lang.mod_options}$jump
    {ibf.lang.post_to_quote}
    {ibf.lang.post_to_quote_txt} -
    {ibf.lang.ib_code_buttons}
    {ibf.lang.ibf_code_txt} - - - - - - - - - -
    - - - - - - Close Current Tag
    - - - - - - - - - Close All Tags -
    -
    {ibf.lang.post}
    ({ibf.lang.check_length})

    - - - - - - - - -
    {ibf.lang.enable_emo}
    {ibf.lang.enable_sig}
    {ibf.lang.unreg_namestuff}
    {ibf.lang.guest_name}
    {ibf.lang.tt_poll_settings}
    {ibf.lang.poll_choices} - - - - - -
    {ibf.lang.poll_only}
    - - - - - - - - - - {ibf.vars.board_name} [Powered by IB Forums] - - - - - - - - - - - - - - -
    - - {ibf.lang.title} -

    - -{ibf.vars.board_name}
    - +--{ibf.lang.forum}: $forum_name
    - +---{ibf.lang.topic}: $topic_title {ibf.lang.start} $topic_starter -
    -
    -
    - - - - diff --git a/upload/style_templates/1/skin_profile.html b/upload/style_templates/1/skin_profile.html deleted file mode 100644 index 68008b11..00000000 --- a/upload/style_templates/1/skin_profile.html +++ /dev/null @@ -1,159 +0,0 @@ - - - -
    {ibf.lang.edit_my_sig} | - {ibf.lang.edit_avatar} | - {ibf.lang.edit_profile}
    - - - - - - - -
    {$info['name']}
    {ibf.lang.find_posts} | - {ibf.lang.add_to_contact}
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.active_stats}
    {ibf.lang.total_posts}{$info['posts']}
    ( {$info['total_pct']}% {ibf.lang.total_percent} )
    {ibf.lang.posts_per_day}{$info['posts_day']}
    {ibf.lang.joined}{$info['joined']}
    {ibf.lang.fav_forum}{$info['fav_forum']}
    {$info['fav_posts']} {ibf.lang.fav_posts}
    ( {$info['percent']}% {ibf.lang.fav_percent} )
    {ibf.lang.user_local_time}{$info['local_time']}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.communicate}
    {ibf.lang.email}{$info['email']}
    {ibf.lang.aim}{$info['aim_name']}
    {ibf.lang.icq}{$info['icq_number']}
    {ibf.lang.yahoo}{$info['yahoo']}
    {ibf.lang.msn}{$info['msn_name']}
    {ibf.lang.pm}{ibf.lang.click_here}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.info}
    {ibf.lang.mgroup}{$info['group_title']}
    {ibf.lang.mtitle}{$info['member_title']}
    {ibf.lang.homepage}{$info['homepage']}
    {ibf.lang.birthday}{$info['birthday']}
    {ibf.lang.location}{$info['location']}
    {ibf.lang.interests}{$info['interests']}
    -
    - - - - - - - - - - - - -
    {ibf.lang.post_detail}
    {ibf.lang.avatar}{$info['avatar']}
    {ibf.lang.siggie}{$info['signature']}
    -
    <( {ibf.lang.back} )
    -
    - - - - diff --git a/upload/style_templates/1/skin_register.html b/upload/style_templates/1/skin_register.html deleted file mode 100644 index adbdc901..00000000 --- a/upload/style_templates/1/skin_register.html +++ /dev/null @@ -1,215 +0,0 @@ - - - -
    -
    - - - - - - -
    {ibf.lang.lp_header}

    {ibf.lang.lp_text}
    -
    - - -
    - - - - - - - - - -
    {ibf.lang.complete_form}
    {ibf.lang.lp_user_name}
    - -
    -
    -
    - - - - - - - - - - - -
    - - - - - - - -
    {ibf.lang.registration_process}
    {ibf.lang.thank_you} {$member['name']}. {ibf.lang.auth_text} {$member['email']}
    -
    - - - - - - - - - - - -
    - - - - - - - -
    {ibf.lang.registration_process}
    {ibf.lang.thank_you} {$member['name']}. {ibf.lang.preview_reg_text}
    -
    - - - - - - - - -
    -
    - - - - - - - -
    {ibf.lang.dumb_header}

    {ibf.lang.dumb_text}
    -
    - - -
    - - - - - - - - - - - - - -
    {ibf.lang.complete_form}
    {ibf.lang.user_id}
    {ibf.lang.val_key}
    - -
    -
    -
    - - - - - - - - -
    -
    - - - - - - -
    {ibf.lang.reg_header}

    {$data['TEXT']}
    -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.complete_form}
    {ibf.lang.user_name}
    {ibf.lang.pass_word}
    {ibf.lang.re_enter_pass}
    {ibf.lang.email_address}
    {ibf.lang.email_address_two}
    -
    -
    - - -
    - - - - - - - - -
    {ibf.lang.terms_service}
    {ibf.lang.terms_service_text}
    - -

    {ibf.lang.agree_submit}  -
    - -
    -
    -
    - - - - diff --git a/upload/style_templates/1/skin_search.html b/upload/style_templates/1/skin_search.html deleted file mode 100644 index 18a5b71b..00000000 --- a/upload/style_templates/1/skin_search.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - -
    {$Data['folder_img']}{$Data['topic_icon']} - - - - - -
    {$Data['go_new_post']}{$Data['prefix']} {$Data['title']} {$Data[PAGES]}
    - {$Data['description']}
    {$Data['forum_name']}{$Data['starter']}{$Data['posts']}{$Data['views']}{$Data['last_post']}
    {$Data['last_text']} {$Data['last_poster']}
     
    - - - - - - - - - - -
    {$Data[SHOW_PAGES]}
    - - - - - - - - - - - - - -
    {ibf.skin.B_NEW} {ibf.lang.pm_open_new}{ibf.skin.B_HOT} {ibf.lang.pm_hot_new}{ibf.skin.B_POLL} {ibf.lang.pm_poll}{ibf.skin.B_LOCKED} {ibf.lang.pm_locked}
    {ibf.skin.B_NORM} {ibf.lang.pm_open_no}{ibf.skin.B_HOT_NN} {ibf.lang.pm_hot_no}{ibf.skin.B_POLL_NN} {ibf.lang.pm_poll_no}{ibf.skin.B_MOVED} {ibf.lang.pm_moved}
    - - - - - - - - -
    - - - - $hidden_fields -
    - - - - -
    - - - - - - - - - - - - -
    {ibf.lang.keywords_title}
    {ibf.lang.key_search}{ibf.lang.mem_search}
     

    {ibf.lang.keysearch_text}


     {ibf.lang.match_name_ex}
     {ibf.lang.match_name_pa}
    -
    - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    {ibf.lang.search_options}
    {ibf.lang.search_where}{ibf.lang.search_refine}
    - - - - - - - - - - - - - -
     {ibf.lang.search_cats}$cats
     {ibf.lang.search_forums}$forums
     {ibf.lang.in_posts} {ibf.lang.in_topics}
    -
    - - - - - -
    - {ibf.lang.search_from} -
    - -
    {ibf.lang.and}  {ibf.lang.older}  {ibf.lang.newer} -
    - {ibf.lang.sort_results}
    - -
    {ibf.lang.descending} -
    {ibf.lang.ascending} -
    -
    -
    -
    - - - - - - - - - -
    - - - - - -
    {ibf.lang.active_topics}
    {$Data[SHOW_PAGES]}
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - {ibf.lang.active_st_text} - -   {ibf.lang.active_end_text}   - -    -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - -
     {ibf.lang.h_topic_title}{ibf.lang.h_forum_name}{ibf.lang.h_topic_starter}{ibf.lang.h_replies}{ibf.lang.h_hits}{ibf.lang.h_last_action}
    - - - -
    {$Data[SHOW_PAGES]}
    - - -
    - - - - - - - - - diff --git a/upload/style_templates/1/skin_topic.html b/upload/style_templates/1/skin_topic.html deleted file mode 100644 index 7b92e75a..00000000 --- a/upload/style_templates/1/skin_topic.html +++ /dev/null @@ -1,260 +0,0 @@ - - - -( {ibf.lang.mod_cp} ) - - - - - - - -  {ibf.lang.snitch_geezer_to_a_copper} - - - - - - - -{ibf.lang.ip}: $data - - - - - - - -( {ibf.lang.go_new_post} ) - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - diff --git a/upload/style_templates/1/skin_stats.html b/upload/style_templates/1/skin_stats.html deleted file mode 100644 index 6cdcfe87..00000000 --- a/upload/style_templates/1/skin_stats.html +++ /dev/null @@ -1,113 +0,0 @@ - - - -
     {ibf.lang.h_topic_title}{ibf.lang.h_forum_name}{ibf.lang.h_topic_starter}{ibf.lang.h_replies}{ibf.lang.h_hits}{ibf.lang.h_last_action}
    {ibf.lang.active_no_topics}
    - - - -
    {$title}
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    $group
    {ibf.lang.leader_name}{ibf.lang.leader_forums}{ibf.lang.leader_location} 
    {$info['name']}$forums{$info['location']}{$info['msg_icon']}
    -
    -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.member}{ibf.lang.member_joined}{ibf.lang.member_posts}{ibf.lang.member_today}{ibf.lang.member_percent}
    {$info['name']}{$info['joined']}{$info['posts']}{$info['tpost']}{$info['today_pct']}%
    {ibf.lang.total_today} $info
    -
    - - - - - - - -
    {ibf.lang.no_info}
    - - - - -
    $modcp -
    - - - - - -   -
    -
    - - - - - - - - - - - - - - - -
    - - - - -
    - - - - - -
    {ibf.lang.topic_stats}{ibf.lang.track_topic} | - {ibf.lang.forward} | - {ibf.lang.print}
    -
    -
    - - - - - -
    {$data[TOPIC][SHOW_PAGES]}
    Back to {$data['FORUM']['name']}
    {$data[TOPIC][REPLY_BUTTON]}{ibf.skin.A_POST}{$data[TOPIC][POLL_BUTTON]}
    -
    - - - - -
    {$data[FORUM]['JUMP']}
    -
    - - - - - - - - -
    {$data[POSTER]['name']} - - - - - -
    {$data[POST]['post_icon']}{ibf.lang.posted_on} {$data[POST]['post_date']}{$data[POST]['delete_button']}{$data[POST]['edit_button']}{ibf.skin.P_QUOTE}
    -
    - {$data[POSTER]['avatar']}

    - {$data[POSTER]['title']}
    - {$data[POSTER]['member_rank_img']}

    - {$data[POSTER]['member_group']}
    - {$data[POSTER]['member_posts']}
    - {$data[POSTER]['member_number']}
    - {$data[POSTER]['member_joined']}
    - {$data[POSTER][WARN_GFX]}

    -
    -
    {$data[POST]['post']} {$data[POST]['attachment']} {$data[POST]['signature']}
      - - - - - - -
    {$data[POSTER]['message_icon']}{$data[POSTER]['email_icon']}{$data[POSTER]['website_icon']}{$data[POSTER]['icq_icon']}{$data[POSTER]['aol_icon']}{$data[POSTER]['yahoo_icon']}{$data[POSTER]['msn_icon']}{$data[POST]['ip_address']}{$data[POST]['report_link']}Top
    -
    - - - - -
    {$data['TOPIC']['SHOW_PAGES']} {$data['TOPIC']['go_new']}{$data[TOPIC][REPLY_BUTTON]}{ibf.skin.A_POST}{$data[TOPIC][POLL_BUTTON]}
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $hidden_field - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - -
    {$data['TOPIC']['title']}{$data['TOPIC']['description']}
    -
    - - - - - - - - - - - - - -

    {ibf.lang.pic_attach}

    -
    - - - - - -
    « {ibf.lang.t_old} | {ibf.lang.t_new} » - {ibf.lang.track_topic} | - {ibf.lang.forward} | - {ibf.lang.print}
    -
    - - - -
    {ibf.lang.pic_attach}
    -

    - - - - - - - -

    - - - - - - - - -
    User Attached Image{ibf.lang.attach_dl}
    {$data['name']} ( {ibf.lang.attach_hits}: {$data['hits']} )
    -

    - - - - diff --git a/upload/style_templates/1/skin_ucp.html b/upload/style_templates/1/skin_ucp.html deleted file mode 100644 index 03a1dcd1..00000000 --- a/upload/style_templates/1/skin_ucp.html +++ /dev/null @@ -1,935 +0,0 @@ - - - -

    {ibf.lang.birthday} - - - -
    {ibf.lang.change_email_title}
    $txt
    {ibf.lang.ce_new_email}
    {ibf.lang.ce_new_email2}
    {ibf.lang.account_pass_title}
    {ibf.lang.pass_change_text}
    {ibf.lang.account_pass_old}
    {ibf.lang.account_pass_new}
    {ibf.lang.account_pass_new2}
    {ibf.lang.personal_ops}
    {ibf.member.name}, {ibf.lang.personal_ops_txt}
    {ibf.lang.edit_profile}

    {ibf.lang.edit_profile_txt}
    {ibf.lang.member_title}
    {ibf.lang.av_current}
    {ibf.lang.this_avatar}{$data[CUR_AV]}
    {ibf.lang.avatar_pre_title}
    {ibf.lang.avatar_pre_txt}{$data[AVATARS]}     {$data[SHOW_AVS]}
    {ibf.lang.upload_avatar}
    $text
    {ibf.lang.avatar_url_title}
    {ibf.lang.avatar}
    {ibf.lang.avatar_url_ext}
    $allowed_ext
    {ibf.lang.avatar_dims}
    {ibf.lang.maximum} {ibf.lang.width} = {ibf.vars.av_width} {ibf.lang.pixels}
    {ibf.lang.maximum} {ibf.lang.height} = {ibf.vars.av_height} {ibf.lang.pixels})
    {ibf.lang.width}     x   {ibf.lang.height}  
    {ibf.lang.av_tt_one}
    {ibf.lang.av_tt_two}
    {ibf.lang.avatar_ops}

    {ibf.lang.avatar_ops_txt}
    {ibf.lang.cp_current_sig}
    - - - - -
    $sig
    -
    {ibf.lang.cp_edit_sig}
    - - - - - - - - - -
    - - - - - - Close Current Tag
    - - - - - - - - - Close All Tags -
    -

    ({ibf.lang.check_length})
    {ibf.lang.profile_title}
    {ibf.lang.website}
    {ibf.lang.icq}
    {ibf.lang.aol}
    {ibf.lang.yahoo}
    {ibf.lang.msn}
    {ibf.lang.location}
    ({ibf.lang.check_length})
    {ibf.lang.interests}
    ({ibf.lang.check_length})
    - -
    - - - - - - -
    -   -
    - - - - - - - - - -
      
    - - - - -
    - - - {ibf.lang.m_messenger}
    -
    - • {ibf.lang.mess_new}
    - • {ibf.lang.mess_contact}
    - • {ibf.lang.mess_folders}
    - • {ibf.lang.mess_inbox}
    - • {ibf.lang.mess_archive}
    -
    - - - {ibf.lang.m_personal}
    -
    - • {ibf.lang.m_contact_info}
    - - • {ibf.lang.m_sig_info}
    - • {ibf.lang.m_avatar_info}
    - - - -
    - {ibf.lang.m_options}
    -
    - • {ibf.lang.m_email_opt}
    - • {ibf.lang.m_board_opt}
    - • {ibf.lang.m_skin_lang}
    - • {ibf.lang.m_email_change}
    - • {ibf.lang.m_passy_opt}
    - - -
    - {ibf.lang.m_tracker}
    -
    - • {ibf.lang.m_view_subs} -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - {ibf.lang.stats_header} - - - - - - - - - - - - - - - - - - - - -
    {ibf.lang.email_address}{$member[MEMBER_EMAIL]}
    {ibf.lang.number_posts}{$member[MEMBER_POSTS]}
    {ibf.lang.registered}{$member[DATE_REGISTERED]}
    {ibf.lang.daily_average}{$member[DAILY_AVERAGE]}
    - - - - {ibf.lang.messenger_summary} - - - - - - - - - - - - -
    {ibf.lang.total_messages}{$member['total_messages']} {$member['full_percent']}
    {ibf.lang.messages_left}{$member['space_free']} {$member['full_messenger']}
    - - - - {ibf.lang.note_pad} - - - -
    - - - - - - - -
    - -
    -
    - - - - - -
    {ibf.lang.ta_size}  - - -
    -
    - - - - - - - - - -
    - - - - - - {ibf.lang.settings_time} - - - {ibf.lang.settings_time_txt}
    $time - - - $time_select - - - {ibf.lang.dst_box} - - - - - - - - - - - - - - - - - {ibf.lang.settings_title} - - - {ibf.lang.settings_lang_txt} - $lang_select - - - - - - - - - - {ibf.lang.settings_skin} - - - {ibf.lang.settings_skin_txt} - $skin    - - - - - - - - - -
    - - - - - - - - - - {ibf.lang.settings_display} - - - {ibf.lang.settings_viewsig} - {$data[SIG]} - - - {ibf.lang.settings_viewimg} - {$data[IMG]} - - - {ibf.lang.settings_viewava} - {$data[AVA]} - - - {ibf.lang.settings_dopopup} - {$data[POP]} - - - {ibf.lang.hide_session_txt} - {$data[SESS]} - - - - - - - - - - - -
    - - - - {ibf.lang.privacy_settings} - - - - {ibf.lang.hide_email} - - - - {ibf.lang.admin_send} - - - {ibf.lang.board_prefs} - - - - {ibf.lang.send_full_msg} - - - - - - -
    - - - - - - - - - - - {ibf.lang.subs_header} - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     {ibf.lang.subs_topic}{ibf.lang.subs_replies}{ibf.lang.subs_view}{ibf.lang.subs_last_post}
    {$data['folder_icon']}{$data['title']} ( {ibf.lang.new_window} )
    {$data['description']}{ibf.lang.subs_start} {$data['start_date']}
    {$data['posts']}{$data['views']}{$data['last_post_date']}
    {ibf.lang.subs_by} {$data['last_poster']}
      {ibf.lang.with_selected}
    - - - - - - - - -
    - - - - - -
    -
    - -
    -
    {$data}
    -
    - - - - diff --git a/upload/upgrade4.php b/upload/upgrade4.php new file mode 100644 index 00000000..8f3d3a4a --- /dev/null +++ b/upload/upgrade4.php @@ -0,0 +1,1109 @@ + Upgrade Script #4 +| > Script written by Matt Mecham +| > Date started: 23rd October 2002 +| ++-------------------------------------------------------------------------- +*/ + +//----------------------------------------------- +// USER CONFIGURABLE ELEMENTS +//----------------------------------------------- + +// Root path + +$root_path = "./"; + +//----------------------------------------------- +// NO USER EDITABLE SECTIONS BELOW +//----------------------------------------------- + +error_reporting (E_ERROR | E_WARNING | E_PARSE); +set_magic_quotes_runtime(0); + +$template = new template; +$std = new installer; + +$VARS = $std->parse_incoming(); + +//-------------------------------- +// Import $INFO, now! +//-------------------------------- + +require $root_path."conf_global.php"; + +//-------------------------------- +// Load the DB driver and such +//-------------------------------- + +$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; + +$to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; +require ($to_require); + +$DB = new db_driver; + +$DB->obj['sql_database'] = $INFO['sql_database']; +$DB->obj['sql_user'] = $INFO['sql_user']; +$DB->obj['sql_pass'] = $INFO['sql_pass']; +$DB->obj['sql_host'] = $INFO['sql_host']; +$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; + +// Get a DB connection + +$DB->connect(); + +// Switch off auto_error + +$DB->return_die = 1; + +//--------------------------------------- +// Sort out what to do.. +//--------------------------------------- + +switch($VARS['a']) +{ + case 'tables': + do_tables(); + break; + + case 'alter': + do_alter(); + break; + + case 'index': + do_index(); + break; + + case 'insert': + do_insert(); + break; + + case 'templates': + do_templates(); + break; + + case 'cleanup': + do_cleanup(); + break; + + default: + do_intro(); + break; +} + +function do_cleanup() +{ + global $std, $template, $root, $DB; + + // Insert new CSS + + $DB->query("INSERT INTO ibf_css (css_name, css_text, css_comments) VALUES ('Invision Style Sheet (NEW)', 'form { display:inline }\r\nTABLE, TR, TD { font-family: Verdana, Tahoma, Arial; font-size: 8.5pt; color: #000000 }\r\na:link, a:visited, a:active { text-decoration: underline; color: #000000 }\r\na:hover { color: #465584 }\r\n.hlight { background-color: #DFE6EF }\r\n.dlight { background-color: #EEF2F7 }\r\n.mainbg { background-color: #FFFFFF }\r\n.mainfoot { background-color: #BCD0ED }\r\n.forum1 { background-color: #DFE6EF }\r\n.forum2 { background-color: #E4EAF2 }\r\n.post1 { background-color: #F5F9FD }\r\n.post2 { background-color: #EEF2F7 }\r\n.posthead { background-color: #E4EAF2 }\r\n\r\n.postbak { background-color: #D2D2D0 }\r\n.title { background-color: #C4DCF7 }\r\n.row1 { background-color: #EEF2F7 }\r\n.row2 { background-color: #F5F9FD }\r\n.postsep { background-color: #C7D2E0; height: 1px }\r\n\r\n.signature { font-size: 7.5pt; color: #333399 }\r\n.postdetails { font-size: 7.5pt }\r\n.postcolor, #postcolor { font-size: 9pt; line-height: 160% }\r\n.membertitle { font-size: 10px; line-height: 150%; color: #000000 }\r\n.normalname { font-size: 12px; font-weight: bold; color: #000033; padding-bottom: 2px }\r\n.normalname a:link, .normalname a:visited, .normalname a:active { text-decoration: underline; color: #000033; padding-bottom: 2px }\r\n.unreg { font-size: 11px; font-weight: bold; color: #990000 }\r\n.highlight { color: #FF0000 }\r\n.highlight a:link, .highlight a:visited, .highlight a:active { text-decoration: underline; color: #FF0000 }\r\n.highlight a:hover { text-decoration: underline }\r\n.desc { font-size: 8.0pt; color: #434951 }\r\n.copyright { font-family: Verdana, Tahoma, Arial; font-size: 7.5pt; line-height: 12px }\r\n.category { font-weight: bold; line-height: 150%; color: #4C77B6; background-color: #C2CFDF }\r\n.category a:link, #category a:visited, #category a:active { text-decoration: none; color: #4C77B6 }\r\n.postfoot {\r\n\r\n font-weight:bold;\r\n\r\n color:#3A4F6C;\r\n\r\n height: 24px;\r\n\r\n background-color: #D1DCEB;\r\n\r\n}\r\n.titlefoot { font-weight: bold; color: #3A4F6C; height: 24px; background-color: #BCD0ED }\r\n.titlemedium {\r\n\r\n font-weight:bold;\r\n color:#3A4F6C;\r\n\r\n height: 30px;\r\n\r\n background-color: #9FBCE3;\r\n \r\n background-image: url(style_images/<#IMG_DIR#>/tile_sub.gif);\r\n\r\n}\r\n.titlemedium a:link, .titlefoot a:link, .titlemedium a:visited, .titlefoot a:visited, .titlemedium a:active, .titlefoot a:active { text-decoration: underline; color: #3A4F6C }\r\n.titlemedium a:hover, .subtitle a:hover, .titlefoot a:hover { text-decoration: underline; color: #000000 }\r\n.maintitle {\r\n\r\n color:#FFFFFF;\r\n\r\n font-size: 9.5pt;\r\n \r\n height: 26px;\r\n \r\n background-image: url(style_images/<#IMG_DIR#>/tile_back.gif);\r\n\r\n}\r\n.edit { font-size: 9px }\r\n.fancyborder { border: 1px dashed #999999 }\r\n.solidborder { border: 1px solid #999999 }\r\n.maintitle a:link, .maintitle a:visited, .maintitle a:active { text-decoration: none; color: #FFFFFF }\r\n.maintitle a:hover { text-decoration: underline }\r\n.nav { font-weight: bold; color: #000000; font-size: 8.5pt }\r\n.pagetitle { color: #4C77B6; font-size: 18px; font-weight: bold; letter-spacing: -1px; line-height: 120% }\r\n.useroptions { background-color: #598CC3; height: 25px; font-weight: bold; color: #FFFFFF }\r\n.useroptions a:link, .useroptions a:visited,.useroptions a:active { text-decoration: none; color: #FFFFFF }\r\n.bottomborder { border-bottom: 1px dashed #D2D2D0 }\r\n.linkthru { color: #000000; font-size:8.5pt }\r\n.linkthru a:link, .linkthru a:active { text-decoration: underline; color: #000000 }\r\n.linkthru a:visited { text-decoration: underline; color: #000000 }\r\n.linkthru a:hover { text-decoration: underline; color: #465584 }\r\n#QUOTE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }\r\n#CODE { font-family: Verdana, Arial; font-size: 8pt; color: #333333; background-color: #FAFCFE; border: 1px solid Black; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px }\r\n.codebuttons { font-size: 8.5pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.forminput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.textinput { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n.input { font-size: 9pt; font-family: verdana, helvetica, sans-serif; vertical-align: middle }\r\n', NULL)"); + + $new_css_id = $DB->get_insert_id(); + + // Get old skin details + + $DB->query("SELECT * FROM ibf_skins WHERE default_set=1"); + + $old_skin = $DB->fetch_row(); + + // First off, change all old skin sets to hidden + + $DB->query("UPDATE ibf_skins SET hidden=1, default_set=0"); + + // Change upload perms.. + + $DB->query("UPDATE ibf_forums SET upload_perms=''"); + + // Get a new ID for the new skin set + + $barney = array( 'sname' => "IBF Skin Set (NEW)", + 'set_id' => 1, + 'tmpl_id' => $old_skin['tmpl_id'], + 'img_dir' => 1, + 'css_id' => $new_css_id, + 'hidden' => 0, + 'default_set'=> 1, + 'macro_id' => 1, + ); + + + $DB->query("SELECT MAX(sid) as new_id FROM ibf_skins"); + + $row = $DB->fetch_row(); + + $barney['sid'] = $row['new_id'] + 1; + + $db_string = $DB->compile_db_insert_string( $barney ); + + $DB->query("INSERT INTO ibf_skins (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); + + // Change member skins to default + + $DB->query("UPDATE ibf_members SET skin=NULL"); + + $template->print_top('Upgrade Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The upgrade was successful! +

    + Forum Upload Permission Changes +
    + Note, due to the way that the upload permissions are handled in v1.1, the upload permissions for all forums + have been removed. You will need to log into your Admin CP and set up the permissions using the new system. +

    + Skin Set Changes +
    + The skin, templates and macros are handled completely differently in this new version. Unfortunately v1.0.X + skins are not compatible with this new version. All old skin sets have been set to 'hidden' and all members + have been moved onto the new default skin. +

    + The new skin set will use the directory 'style_images/1/' as the image directory. Ensure that all the images + in there have been updated from the download zip. If the directory does not exist, create it and upload + the contents of the folder 'style_images/1/' from the zip file. +

    + PLEASE REMOVE THIS UPGRADE SCRIPT AS SOON AS POSSIBLE +
    +
    +
    "; + + + + $template->output(); +} + + +//+--------------------------------------- + + + +function do_templates() +{ + global $std, $template, $root, $DB; + + //----------------------------------- + // Lets open the style file + //----------------------------------- + + $style_file = $root.'install_templates.txt'; + + if ( ! file_exists($style_file) ) + { + install_error("Could not locate '$style_file'.

    Check to ensure that this file exists in the same location as this script.

    You may need to enter a value for the root path in this installer script, to do this, simply open up this script in a text editor and enter a value in \$root - remember to add a trailing slash. NT users will need to use double backslashes"); + } + + if ( $fh = fopen( $style_file, 'r' ) ) + { + $data = fread($fh, filesize($style_file) ); + fclose($fh); + } + else + { + install_error("Could open '$style_file'"); + } + + if (strlen($data) < 100) + { + install_error("Err 1:'$style_file' is incomplete, please re-upload a fresh copy over the existing copy on the server'"); + } + + // Chop up the data file. + + $template_rows = explode( "||~&~||", $data ); + + $crows = count($template_rows); + + if ( $crows < 100 ) + { + install_error("Err2: (Found $crows rows) '$style_file' is incomplete, please re-upload a fresh copy over the existing copy on the server'"); + } + + //----------------------------------- + // Lets populate the database! + //----------------------------------- + + foreach( $template_rows as $q ) + { + $DB->error = ""; + + $q = trim($q); + + //print $q; + + if (strlen($q) < 5) + { + continue; + } + + $DB->query("INSERT INTO ibf_skin_templates (set_id, group_name, section_content, func_name, func_data, updated, can_remove) VALUES $q"); + + if ( $DB->error != "" ) + { + install_error( "mySQL Error: ".$DB->error ); + } + } + + //--------------------------------------- + + $template->print_top('Step 5 Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The new templates been inserted +

    + You may now proceed to the next step. +
    +
    +
    "; + + + $template->contents .= "
    Proceed to Step 6: Finishing Up >>"; + + $template->output(); +} + + +//+--------------------------------------- + + + +function do_insert() +{ + global $std, $template, $root, $DB; + + run_sql('insert'); + + $template->print_top('Step 4 Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The new data has been inserted +

    + You may now proceed to the next step. +
    +
    +
    "; + + + $template->contents .= "
    Proceed to Step 5: Insert New Templates >>"; + + $template->output(); +} + + +//+--------------------------------------- + + +function do_index() +{ + global $std, $template, $root, $DB; + + run_sql('index'); + + $template->print_top('Step 3 Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The indexes have been created +

    + You may now proceed to the next step. +
    +
    +
    "; + + + $template->contents .= "
    Proceed to Step 4: Insert New Data >>"; + + $template->output(); +} + + +//+--------------------------------------- + +function do_alter() +{ + global $std, $template, $root, $DB; + + run_sql('alter'); + + $template->print_top('Step 2 Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The tables have been altered +

    + You may now proceed to the next step. +
    +
    +
    "; + + + $template->contents .= "
    Proceed to Step 3: Add Indexes >>"; + + $template->output(); +} + + +//+--------------------------------------- + +function do_tables() +{ + global $std, $template, $root, $DB; + + run_sql('tables'); + + $template->print_top('Step 1 Complete'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + The new tables have been created +

    + You may now proceed to the next step. +
    +
    +
    "; + + + $template->contents .= "
    Proceed to Step 2: Alter Existing Tables >>"; + + $template->output(); +} + + +//+--------------------------------------- + +function do_intro() +{ + global $std, $template, $root; + + $template->print_top('Welcome'); + + $template->contents .= " + • Upgrade from v1.0.X to v1.1 + + + + + + +
    + + + + +
    + + + + +
    + Welcome to the Invision Board Upgrade Utility +

    + Before you run this upgrade tool, please ensure that ALL of the source, language and skin files + have been uploaded into the corresponding directories on your server. +

    + This script should be in the root forum directory (the same directory that index.php is in). +

    + This installer will alter the database for the new format and install the skin and macro files. +

    + Please ensure that 'install_templates.txt' is uploaded and in the same directory as this script. +

    + Also, please ensure that all the new skin_*.php files have been uploaded into 'Skin/s1' before starting + this upgrader. If you wish to keep the old skin data in that directory, please copy the directory now before + proceeding. Running this installer will set all existing skins to 'hidden' and install a new default skin pack +
    +
    +
    "; + + $style_file = $root."install_templates.txt"; + + $warnings = array(); + + if ( ! file_exists($style_file) ) + { + $warnings[] = "Cannot locate the file 'install_templates.txt'. This should be uploaded into the same directory as this script!"; + } + + if ( count($warnings) > 0 ) + { + + $err_string = "
    • ".implode( "
    • ", $warnings )."
    "; + + $template->contents .= " + • WARNING! + + + + + + +
    + + + + +
    + + + + +
    + The following errors must be rectified before continuing! +

    + $err_string +
    +
    +
    "; + } + else + { + $template->contents .= "
    Proceed to Step 1: Create New Tables >>"; + } + + $template->output(); +} + + + +function install_error($msg="") +{ + global $std, $template, $root; + + $template->print_top('Warning!'); + + + + $template->contents .= " + • WARNING! + + + + + + +
    + + + + +
    + + + + +
    + The following errors must be rectified before continuing!
    Please go back and try again! +

    + $msg +
    +
    +
    "; + + + + $template->output(); +} + + + + +//+------------------------------------------------- +// GLOBAL ROUTINES +//+------------------------------------------------- + +function fatal_error($message="", $help="") { + echo("$message

    $help"); + exit; +} + + +//+-------------------------------------------------------------------------- +// CLASSES +//+-------------------------------------------------------------------------- + + + +class template +{ + var $contents = ""; + + function output() + { + echo $this->contents; + echo " + +

    © 2002 Invision Board (www.invisionboard.com)
    + + + "; + exit(); + } + + //-------------------------------------- + + function print_top($title="") + { + + $this->contents = " + Invision Upgrader :: $title + + + + + + + + +
    +
    + + "; + + } + + +} + + +class installer +{ + + function parse_incoming() + { + global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR; + $return = array(); + + if( is_array($HTTP_GET_VARS) ) + { + while( list($k, $v) = each($HTTP_GET_VARS) ) + { + //$k = $this->clean_key($k); + if( is_array($HTTP_GET_VARS[$k]) ) + { + while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) + { + $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); + } + } + else + { + $return[$k] = $this->clean_value($v); + } + } + } + + // Overwrite GET data with post data + + if( is_array($HTTP_POST_VARS) ) + { + while( list($k, $v) = each($HTTP_POST_VARS) ) + { + //$k = $this->clean_key($k); + if ( is_array($HTTP_POST_VARS[$k]) ) + { + while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) + { + $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2); + } + } + else + { + $return[$k] = $this->clean_value($v); + } + } + } + + return $return; + } + + function clean_key($key) { + + if ($key == "") + { + return ""; + } + + $key = preg_replace( "/\.\./" , "" , $key ); + $key = preg_replace( "/\_\_(.+?)\_\_/" , "" , $key ); + $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key ); + return $key; + } + + function clean_value($val) { + + if ($val == "") + { + return ""; + } + + $val = preg_replace( "/&/" , "&" , $val ); + $val = preg_replace( "//" , "-->" , $val ); + $val = preg_replace( "/