MyBB Community Forums

Full Version: [Page Manager] Share your custom pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
to contact page
how to display the "CAPTCHA" image 2
and who should use the "CAPTCHA" group under 3

I replace this code

if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

replaced with this, but it does not work and does not appear

if($mybb->settings['captchaimage'] == 2 && function_exists("imagepng") && ($mybb->user['usergroup'] < 3))

I want to display the "CAPTCHA" image 2
as shown below attachments

help me Huh
I don't know how to add my page to the top of the website...
OMG your username would completely destroy MentionMe! Stay away!

* Wildcard holds up a cross and backs away slowly yelling something about editing the header template
(2013-04-21, 11:43 PM)Wildcard Wrote: [ -> ]OMG your username would completely destroy MentionMe! Stay away!

* Wildcard holds up a cross and backs away slowly yelling something about editing the header template

Whose username? Mine?
is there anything that can help my problem Sad
(2013-04-16, 11:50 PM)SunDi3yansyah Wrote: [ -> ]I replace this code

if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])

with this

if($mybb->settings['captchaimage'] == 2 && function_exists("imagepng") && ($mybb->user['usergroup'] < 3))

I didn't even look at the source to check-- just hurriedly trying to help:

if($mybb->settings['captchaimage'] == 2 && function_exists("imagepng") && ($mybb->user['usergroup'] == 3))

Should show the Captcha to all those whose Primary User Group ID is 3 . . . usually Super Moderators--

If that isn't what you are trying to do then repost and I'll look when I get on.

Cheers.
@Wildcard :
I want to use reCAPTCHA GID is the group 1 and 2
by reCAPTCHA number two, instead of the default CAPTCHA
the code you've given me to do but it does not work

This page Contact Us
http://www.kampoeng.us/contact
if($mybb->settings['captchaimage'] == 2 && function_exists("imagepng") && (in_array($mybb->user['usergroup'], array(1, 2)))

I don't know anything about the Captcha part, I am just trying to help you with the user permissions. ^That should show Captcha for Guests and Register (checking primary groups only)
it still does not work
you try to see the php code I am using this
what should i edit to get CAPTCHA number 2 (not the default captcha)
and displays in groups 1 and 2

<?php

global $headerinclude, $header, $theme, $footer, $templates, $lang;

$lang->load('member');
$lang->load('messages');
$lang->load('datahandler_user');

$subject = htmlspecialchars_uni(trim($mybb->input['subject']));
$message = htmlspecialchars_uni(trim($mybb->input['message']));

if(!$mybb->user['uid'])
{
	$name = htmlspecialchars_uni(trim($mybb->input['name']));
	$email = htmlspecialchars_uni(trim($mybb->input['email']));

	$usertemplate = '<div class="subject-before">
<label class="subject">{$lang->full_name}</label>:</div>
<div style="float:left;width:590px;font-size:12px;">
<label>
<input type="text" class="textbox" size="50" name="name" value="{$name}" style="width:400px;" />
</label>
</div>
<div style="clear:both;height:20px;"></div>
<div class="subject-before">
<label class="subject">{$lang->email_address}</label>:</div>
<div style="float:left;width:590px;font-size:12px;">
<label>
<input type="text" class="textbox" size="50" name="email" value="{$email}" style="width:400px;" />
</label>
</div>';

	$usertemplate = str_replace("\'", "'", addslashes($usertemplate));

	eval("\$usertemplate = \"" . $usertemplate . "\";");
}
else
{
	$name = $mybb->user['username'];
	$email = $mybb->user['email'];

	eval("\$usertemplate = \"" . $templates->get('changeuserbox') . "\";");
}

if($mybb->input['action'] == 'do_email' && $mybb->request_method == 'post')
{
	verify_post_check($mybb->input['my_post_key']);

	if(empty($name))
	{
		$errors[] = $lang->userdata_missing_username;
	}
	elseif(strpos($name, '<') !== false || strpos($name, '>') !== false || strpos($name, '&') !== false || my_strpos($name, '\\') !== false || strpos($name, ';') !== false || strpos($name, ',') !== false)
	{
		$errors[] = $lang->userdata_bad_characters_username;
	}

	if(empty($email))
	{
		$errors[] = $lang->userdata_missing_email;
	}
	elseif(!validate_email_format($email))
	{
		$errors[] = $lang->userdata_invalid_email_format;
	}

	if(empty($subject))
	{
		$errors[] = $lang->error_no_email_subject;
	}

	if(empty($message))
	{
		$errors[] = $lang->error_no_email_message;
	}

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
	{
		$imagehash = $db->escape_string($mybb->input['imagehash']);
		$imagestring = $db->escape_string($mybb->input['imagestring']);
		$query = $db->simple_select('captcha', '*', 'imagehash="' . $imagehash . '"'); 
		$imgcheck = $db->fetch_array($query);
		if(my_strtolower($imgcheck['imagestring']) != my_strtolower($imagestring) || !$imgcheck['imagehash'])
		{
			$errors[] = $lang->error_regimageinvalid;
		}
		$db->delete_query('captcha', 'imagehash="' . $imagehash . '"');
	}

	if(count($errors) == 0)
	{
		if($mybb->settings['mail_handler'] == 'smtp')
		{
			$from = $email;
		}
		else
		{
			$from = $name . ' <' . $email . '>';
		}
		my_mail($mybb->settings['adminemail'], '[' . $mybb->settings['bbname'] . ' ' . $pages['name'] . '] ' . $subject, $message, $from, '', '', false, 'text', '', $email);

		redirect($mybb->settings['bburl'], $lang->redirect_emailsent);
	}
	else
	{
		$errors = inline_error($errors);
	}
}

if($mybb->settings['captchaimage'] == 1 && function_exists('imagepng') && !$mybb->user['uid'])
{
	$randomstr = random_str(5);
	$imagehash = md5(random_str(12));
	$imagearray= array(
		'imagehash' => $imagehash,
		'imagestring' => $randomstr,
		'dateline' => TIME_NOW
	);
	$db->insert_query('captcha', $imagearray);
	eval("\$captcha = \"" . $templates->get('post_captcha') . "\";");
}

$template = '<html>
<head>
<title>' . $pages['name'] . '</title>

<style>
.error {
	background: none repeat scroll 0 0 #FF0000;
	border: 1px solid transparent;
	border-radius: 4px 4px 4px 4px;
	color: #FFFFFF;
	font-family: Arial,Helvetica,sans-serif;
	font-size: 13px;
	margin: 0 auto;
	padding: 0 0 0 10px;
	width: 30%;
}

.subject-before {
	float: left;
	margin: 3px 20px 0 0;
	text-align: right;
	width: 180px;
}

.subject {
	font-weight: 700;
	margin: 0 15px 0 0;
}

.button {
	background-color: #F2F2F2;
	background-image: -moz-linear-gradient(center top , #F2F2F2 0%, #CCCCCC 100%);
	border: 1px solid #B2B2B2;
	box-shadow: 0 1px 0 #B2B2B2, 0 1px 0 rgba(255, 255, 255, 0.5) inset;
	color: #555555;
	text-shadow: 1px 1px rgba(255, 255, 255, 0.5);
	font-size: 12px;
	height: 23px !important;
	line-height: 23px;
	padding: 0 15px;
	width: auto;
	border-radius: 3px 3px 3px 3px;
	cursor: pointer;
	display: inline-block;
	font-family: Sans-serif;
	font-weight: 700;
	overflow: hidden;
	position: relative;
	text-decoration: none !important;
}

.button:hover, .button:focus {
	background: none repeat scroll 0 0 #E5E5E5;
}

.button a {
    text-decoration: none;
}

.button img {
    border-right: 1px solid rgba(20, 20, 20, 0.125);
    display: block;
    float: left;
    margin-left: -14px;
    margin-right: 10px;
    padding: 1px 5px 5px;
}

.con {
	font-family: Arial,Helvetica,sans-serif;
	font-size: 14px;
	margin: 0 auto;
	width: 860px;
}

.logo-con {
	margin: 0 0 0 660px;
	position: absolute;
}

.con-body {
	-moz-border-radius:20px;
	-webkit-border-radius:20px;
	border-radius:20px;
	background:#FFFFFF;
	box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.3);
}

.con-head {
	background-color:#6B8E23;
	-moz-border-radius:20px 20px 0 0;
	-webkit-border-radius:20px 20px 0 0;
	border-radius:20px 20px 0 0;
	padding:0px 20px 10px 20px;
}

.contact-us {
	float: left;
	margin: 0;
}

.contact-us h1 {
	color: #FFFFFF;
	font-size: 24px;
	font-weight: 700;
	margin: 0;
	text-shadow: 1px 1px 0 #DA9707;
}

.notic {
	float: left;
	color: rgb(244, 183, 54);
	line-height: 24px;
	padding-left: 20px;
}

.notic h2 {
	font-size: 16px;
	margin: 0;
}

.foot {
	background:#CCCCCC;
	-moz-border-radius:0 0 20px 20px;
	-webkit-border-radius:0 0 20px 20px;
	border-radius: 0 0 20px 20px;
	padding: 20px;
}

</style>

</head>
<body bgcolor="#eae5ce">
{$errors}
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />

<div class="con">
	<div class="logo-con">
		<a href="http://www.kampoeng.us">
			<img width="200" height="140" border="0" src="http://www.kampoeng.us/images/logo-contact-us.png">
        </a>
	</div>
	<div style="clear:both;height:90px;"></div>
    <div class="con-body">
		<div class="con-head">
			<br>
			<div class="contact-us">
				<h1>Contact Us</h1>
			</div>
			<div style="clear:both;"></div>
		</div>
		<br>
        <div>
			<div class="subject-before"></div>
			<div class="notic">
				<h2>
					Silakan lengkapi form di bawah ini untuk menghubungi tim Support Kampoeng
					<br>
					Kami akan menghubungi Anda dalam waktu 2 x 24 jam
				</h2>
				<i style="color:red;font-size:12px;display:block;"> Note : Jika dalam 2 x 24 jam anda belum mendapatkan balasan dari kami di email , periksa bagian SPAM dari email anda </i>
			</div>
			<div style="clear:both;height:20px;"></div>

{$usertemplate}

			<div style="clear:both;height:20px;"></div>
			
	<div class="subject-before">
		<label class="subject">{$lang->email_subject}</label>:</div>
			<div id="email_form" style="float:left;width:590px;font-size:12px;">
				<label><input type="text" class="textbox" size="50" name="subject" value="{$subject}" style="width:400px;" /></label>
			</div>
			<div id="email_form" style="float:left;width:590px;font-size:12px;margin-left: 200px;">
			<p style="color:#FF0000;"><b><em>Note: Gunakana Prefix pada kolom "Email Subject" untuk mempermudah Judul</em></b></p>
			<ul>
				<li><b>[General Question]</b></li>
				<li><b>[Account (Aktivasi, Password atau sejenisnya)]</b></li>
				<li><b>[Donatur]</b></li>
				<li><b>[Kampoeng Advertising]</b></li>
				<li><b>[Moderator]</b></li>
				<li><b>[Pengaduan SARA / Pornografi / Penyalahgunaan Lainnya]</b></li>
				<li><b>[Saran & Kritik]</b></li>
				<li><b>[Kerjasama / Public Relation]</b></li>
			</ul>
			<p><em>Misal : </em><b>[Saran & Kritik] Penambahan Forum dan Subforum</b></p>			
			</div>

	<div class="subject-before">
			<label class="subject">{$lang->email_message}</label>:</div>
				<div style="float:left;width:590px;font-size:12px;">
			<label><textarea style="width:400px;" cols="50" rows="10" name="message">{$message}</textarea></label>
				</div>
				
			<div style="clear:both;height:20px;"></div>

{$captcha}

			<div style="clear:both;height:20px;"></div>

<br />

<div class="foot">

<input type="hidden" name="action" value="do_email" />
	<div align="center">
		<input type="submit" class="button" value="{$lang->send_email}" />
	</div>

</div>

<div style="clear:both;"></div>

</div>

</div>
</div>
</div>

</form>
<div style="clear:both;height:10px;"></div>
</body>
</html>';

$template = str_replace("\'", "'", addslashes($template));

eval("\$page = \"" . $template . "\";");

output_page($page);

?>
hello, I saw this thread and I installed the plug-in Page Manager

I would like to put this code on a page but I can not make it work, the map can not be seen

could you give me some advice?

thanks

I apologize for my English

the code:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Google Maps JavaScript API v3 Example: Fusion Tables Layer</title>
<link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>

function initialize()
{

geocoder = new google.maps.Geocoder();
var italia = new google.maps.LatLng(44.948766, 5.691497);
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: italia,
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
// var campminuscolo = idcamping.value.toLowerCase()
var campminuscolo = idcamping.value
var camp = "'" + campminuscolo + "'"
var camp1 = "'1Nome' contains ignoring case " + camp

var layer = new google.maps.FusionTablesLayer({
query: {
select: 'indirizzo',
from: '1cJaE8z4-KMUsSdRHxmDQoWvb7emKFKQscQHnH18',
where: camp1
},

styles: [{
where: "'Info' = 'Sempre'",
markerOptions: {
iconName: "grn_circle"
},
}, {
where: "'Info' = 'Sempre Ma Solo Con Mezzo Proprio'",
markerOptions: {
iconName: "orange_circle"
},
}, {
where: "'Info' = 'Info Non Confermata'",
markerOptions: {
iconName: "wht_circle"
},
}, {
where: "'Info' = 'Solo In Bassa Stagione'",
markerOptions: {
iconName: "red_circle"
},
}, {
where: "'Info' = 'Solo Bassa Stagione E Solo Con Mezzo Proprio'",
markerOptions: {
iconName: "blu_circle"
},
}] //----- Fine styles



//----------------------------
}); //----- Fine layer

layer.setMap(map);

} //------- Fine inizialize
//----------------------------------------
function testenter(e) {
if (e.keyCode == 13) {
initialize();
return false;
}}
//----------------------------------------
//------------------------------------------------------------------------------------------
// In questa sezione ci sono i dati e le funzioni utilizzate per la search delle localita'
//------------------------------------------------------------------------------------------
var geocoder;
var map;
var markersArray = [];
var marker;
//-------------------------------
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode({ 'address': address }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
clearOverlays();
document.getElementById("address").value = results[0]['formatted_address'];
map.setCenter(results[0].geometry.location);
map.setZoom(8);
marker = new google.maps.Marker({
map : map,
title : results[0]['formatted_address'],
position : results[0].geometry.location,
icon : "arrow.png",
animation : google.maps.Animation.DROP
});
markersArray.push(marker);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}

//--------------------------------
function clearOverlays() {
if (markersArray) {
for (i in markersArray) {
markersArray[i].setMap(null);
}
}
}
//-------------------------------
function testenter1(e) {
if (e.keyCode == 13) {
codeAddress();
return false;
}
}
//-------------------------------------------------------------------------------------------------
// FINE - In questa sezione ci sono i dati e le funzioni utilizzate per la search delle localita'
//-------------------------------------------------------------------------------------------------



//-----------------------------------------
</script>

<style>


</style>



</head>
<body onload="initialize()">

<input type="text" id="idcamping" placeholder="Cerca campeggi " onKeyPress ="testenter(event)">
<input type="text" id="address" placeholder="Cerca localita'" onKeyPress ="testenter1(event)">
<div id="map-canvas"></div>
</body>
</html>


no body can help me ? i make someting wrong
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49