| 1 |
<?php |
| 2 |
$Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']); |
| 3 |
$TermsandConditionsText = '<p>Welcome to '.$Domain.'. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern '.$Domain.'\'s relationship with you in relation to this website.</p> |
| 4 |
<p>The term '.$Domain.' or \'us\' or \'we\' refers to the owner of the website. The term \'you\' refers to the user or viewer of our website. |
| 5 |
The use of this website is subject to the following terms of use: |
| 6 |
<ul> |
| 7 |
<li>The content of the pages of this website is for your general information and use only. It is subject to change without notice.</li> |
| 8 |
<li>Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</li> |
| 9 |
<li>Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</li> |
| 10 |
<li>This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</li> |
| 11 |
<li>All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</li> |
| 12 |
<li>Unauthorised use of this website may give rise to a claim for damages and/or be a criminal offence.</li> |
| 13 |
<li>From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</li> |
| 14 |
<li>You may not create a link to this website from another website or document without '.$Domain.'\'s prior written consent.</li></ul></p>'; |
| 15 |
if(get_option('wp_insert_terms_conditions_content') == "") { add_option("wp_insert_terms_conditions_content", $TermsandConditionsText, '', 'yes'); } |
| 16 |
|
| 17 |
add_shortcode('Terms', 'wp_insert_terms_conditions_shortcode'); |
| 18 |
|
| 19 |
function wp_insert_terms_conditions_shortcode() { |
| 20 |
return get_option('wp_insert_terms_conditions_content'); |
| 21 |
} |
| 22 |
|
| 23 |
function wp_insert_terms_conditions_page() { |
| 24 |
if(isset($_GET["assign"])) { |
| 25 |
$my_post = array(); |
| 26 |
$my_post['ID'] = $_GET["assign"]; |
| 27 |
$my_post['post_content'] = '[Terms]'; |
| 28 |
wp_update_post($my_post); |
| 29 |
header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions"); |
| 30 |
} |
| 31 |
else if(isset($_GET["create"])) { |
| 32 |
$my_post = array(); |
| 33 |
$my_post['post_title'] = 'Terms and Conditions'; |
| 34 |
$my_post['post_content'] = '[Terms]'; |
| 35 |
$my_post['post_status'] = 'publish'; |
| 36 |
$my_post['post_author'] = 1; |
| 37 |
$my_post['post_type'] = 'page'; |
| 38 |
wp_insert_post($my_post); |
| 39 |
header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions"); |
| 40 |
} |
| 41 |
else if(isset($_GET["reset"])) { |
| 42 |
$Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']); |
| 43 |
$TermsandConditionsText = '<p>Welcome to '.$Domain.'. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern '.$Domain.'\'s relationship with you in relation to this website.</p> |
| 44 |
<p>The term '.$Domain.' or \'us\' or \'we\' refers to the owner of the website. The term \'you\' refers to the user or viewer of our website. |
| 45 |
The use of this website is subject to the following terms of use: |
| 46 |
<ul> |
| 47 |
<li>The content of the pages of this website is for your general information and use only. It is subject to change without notice.</li> |
| 48 |
<li>Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</li> |
| 49 |
<li>Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</li> |
| 50 |
<li>This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</li> |
| 51 |
<li>All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</li> |
| 52 |
<li>Unauthorised use of this website may give rise to a claim for damages and/or be a criminal offence.</li> |
| 53 |
<li>From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</li> |
| 54 |
<li>You may not create a link to this website from another website or document without '.$Domain.'\'s prior written consent.</li></ul></p>'; |
| 55 |
|
| 56 |
update_option("wp_insert_terms_conditions_content", $TermsandConditionsText); |
| 57 |
header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions"); |
| 58 |
} |
| 59 |
global $screen_layout_columns; |
| 60 |
|
| 61 |
add_meta_box('wp_insert_edit_terms_conditions', 'Finetune your Terms and Conditions', 'wp_insert_edit_terms_conditions_HTML', 'col_1'); |
| 62 |
add_meta_box('wp_insert_edit_assign_terms_conditions_page', 'Assign Page for manage-terms-and-conditions', 'wp_insert_edit_assign_terms_conditions_page_HTML', 'col_1'); |
| 63 |
|
| 64 |
$parameters = 'wp_insert_terms_conditions_content'; |
| 65 |
wp_insert_settings_page_layout($parameters, 'WP-INSERT : manage-terms-and-conditions', 'terms'); |
| 66 |
} |
| 67 |
|
| 68 |
function wp_insert_edit_assign_terms_conditions_page_HTML() { ?> |
| 69 |
<div> |
| 70 |
<p>Assign |
| 71 |
<select id="wp_insert_select_assign_pages" onchange="UpdateAssignlink()"> |
| 72 |
<option value="#" selected="selected">-- Select a Page --</option> |
| 73 |
<?php |
| 74 |
$count = 0; |
| 75 |
$pages = get_pages('sort_column=menu_order'); |
| 76 |
foreach($pages as $page) { |
| 77 |
if($count < 100) { |
| 78 |
echo "<option value='".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&assign=".$page->ID."'>".$page->post_title."</option>"; |
| 79 |
} |
| 80 |
$count++; |
| 81 |
} |
| 82 |
?> |
| 83 |
</select> |
| 84 |
<script type="text/javascript"> |
| 85 |
document.getElementById('wp_insert_select_assign_pages').selectedIndex = 0; |
| 86 |
function UpdateAssignlink() { |
| 87 |
document.getElementById('wp_insert_assign_now_link').href = document.getElementById('wp_insert_select_assign_pages')[document.getElementById('wp_insert_select_assign_pages').selectedIndex].value; |
| 88 |
} |
| 89 |
</script> |
| 90 |
as Terms and Conditions page : <a id="wp_insert_assign_now_link" href="#" class="button-secondary">Assign Now</a></p> |
| 91 |
<p><b>OR</b></p> |
| 92 |
<p>Create Terms and Conditions Page Automatically : <a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&create=1"; ?>" class="button-secondary">Create Now</a></p> |
| 93 |
</div> |
| 94 |
<?php } |
| 95 |
|
| 96 |
function wp_insert_edit_terms_conditions_HTML() { ?> |
| 97 |
<script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/fckeditor.js"></script> |
| 98 |
<textarea id="wp_insert_terms_conditions_content" name="wp_insert_terms_conditions_content" style="width:100%; height: 400px;"> |
| 99 |
<?php echo get_option('wp_insert_terms_conditions_content'); ?> |
| 100 |
</textarea> |
| 101 |
<p><a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&reset=1"; ?>" class="button-secondary alignright">Reset</a></p><p><small>This is an automatically generated "Terms and Conditions".</small></p> |
| 102 |
<script type="text/javascript"> |
| 103 |
if(document.getElementById('wp_insert_terms_conditions_content')) { |
| 104 |
var wp_insert_fckeditor = new FCKeditor('wp_insert_terms_conditions_content') ; |
| 105 |
wp_insert_fckeditor.Height = "400" |
| 106 |
wp_insert_fckeditor.BasePath = '<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/'; |
| 107 |
wp_insert_fckeditor.ReplaceTextarea() ; |
| 108 |
} |
| 109 |
</script> |
| 110 |
<?php } |
| 111 |
?> |
| 112 |
|