Example #1
0
function sendMailToEntrepreneur($user_id, $email, $amount, $user_id, $campaign_name)
{
    $from_address = FROM_EMAIL_ADDRESS;
    $bcc_address = SIVI_ADMIN_EMAIL;
    $to = $email;
    global $funding_for, $pledged, $pledgegoal;
    $so_far_pledged = $pledged + $amount;
    $server = 'https://' . $_SERVER['HTTP_HOST'];
    list($first_name, $last_name, $username, $account_email) = getAccountDetails($user_id);
    $name_of_project = getProjectName($user_id);
    $email = $account_email;
    #$name_of_campaign
    #$subject = "New Donation Alert! $fullName Just Pledged \$$amount USD to $name_of_project on LaunchLeader";
    $subject = "Unfortunately, {$first_name} {$last_name}, Your Campaign was Not Successfully Funded on LaunchLeader";
    $message = "<html><body>\nHi {$first_name},<br> \n<br>\nThank you for creating your {$campaign_name} campaign for <a href=\"{$server}/profile?u={$username}\">{$name_of_project}</a>. <br>\nUnfortunately, this campaign did not reach its funding goal by the deadline. Because campaigns on LaunchLeader<br>\nmust reach their minimum goal in order to receive funding, your donation pledges of \${$amount} USD have been<br>\ncancelled and your donor's credit cards will not be charged<br>\n<br>\nEven though this campaign did not reach its goal, your entrepreneurial spirit is still highly appreciated.<br>\nEntrepreneurship is about overcoming small failures to achieve overall success. We encourage you to<br>\ncontinue engaging your community by going back to the <a href=\"{$server}/profile?u={$username}\">project page</a> and creating new campaigns,<br>\nupdating your profile and posting updates.<br><br>\nAs always, please <a href=\\mailto:support@launchleader.com\">let us know</a> if there’s anything we can do to help!<br>\n<br>\nBest wishes!<br>\n<br>\n The LaunchLeader Team<br>\n</body></html>\n";
    //     'Reply-To: webmaster@example.com' . "\r\n" .
    $headers = "From: {$from_address}" . "\r\n";
    $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
    if ($bcc_address != "") {
        $headers .= "Bcc: {$bcc_address}\r\n";
    }
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    mail($to, $subject, $message, $headers);
}
Example #2
0
function zopim_account_config()
{
    global $usernameToCodeURL, $languagesURL, $current_user;
    ?>
<div class="wrap">
<?php 
    if (isset($_GET["action"]) && $_GET["action"] == "deactivate") {
        update_option('zopimSalt', "");
        update_option('zopimCode', "zopim");
    }
    $message = "";
    $authenticated = "";
    if (isset($_POST["action"]) && $_POST["action"] == "login") {
        if ($_POST["zopimUsername"] != "" && $_POST["zopimPassword"] != "") {
            $logindata = array("email" => $_POST["zopimUsername"], "password" => $_POST["zopimPassword"]);
            $loginresult = json_to_array(zopim_post_request(ZOPIM_LOGIN_URL, $logindata));
            if (isset($loginresult->error)) {
                $error["login"] = "******";
                $gotologin = 1;
                update_option('zopimSalt', "wronglogin");
            } else {
                if (isset($loginresult->salt)) {
                    update_option('zopimUsername', $_POST["zopimUsername"]);
                    update_option('zopimSalt', $loginresult->salt);
                    $account = getAccountDetails(get_option('zopimSalt'));
                    $editor = setEditor(get_option('zopimSalt'));
                    if (isset($account)) {
                        update_option('zopimCode', $account->account_key);
                        if (get_option('zopimGreetings') == "") {
                            $jsongreetings = to_json($account->settings->greetings);
                            update_option('zopimGreetings', $jsongreetings);
                        }
                    }
                } else {
                    update_option('zopimSalt', "");
                    $error["login"] = "******";
                }
            }
        } else {
            update_option('zopimSalt', "wronglogin");
            $gotologin = 1;
            $error["login"] = "******";
        }
    } else {
        if (isset($_POST["action"]) && $_POST["action"] == "signup") {
            $createdata = array("email" => $_POST["zopimnewemail"], "first_name" => $_POST["zopimfirstname"], "last_name" => $_POST["zopimlastname"], "display_name" => $_POST["zopimfirstname"] . " " . $_POST["zopimlastname"], "eref" => $_POST["zopimeref"], "source" => "wordpress", "recaptcha_challenge_field" => $_POST["recaptcha_challenge_field"], "recaptcha_response_field" => $_POST["recaptcha_response_field"]);
            $signupresult = json_to_array(zopim_post_request(ZOPIM_SIGNUP_URL, $createdata));
            if (isset($signupresult->error)) {
                $message = "<div style='color:#c33;'>Error during activation: <b>" . $signupresult->error . "</b>. Please try again.</div>";
            } else {
                if (isset($signupresult->account_key)) {
                    $message = "<b>Thank you for signing up. Please check your mail for your password to complete the process. </b>";
                    $gotologin = 1;
                } else {
                    $message = "<b>Could not activate account. The wordpress installation was unable to contact Zopim servers. Please check with your server administrator to ensure that <a href='http://www.php.net/manual/en/book.curl.php'>PHP Curl</a> is installed and permissions are set correctly.</b>";
                }
            }
        }
    }
    if (get_option('zopimCode') != "" && get_option('zopimCode') != "zopim") {
        $accountDetails = getAccountDetails(get_option('zopimSalt'));
        if (!isset($accountDetails) || isset($accountDetails->error)) {
            $gotologin = 1;
            $error["auth"] = '
	 <div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>Account no longer linked!</span></h3>
		<div style="padding:10px;line-height:17px;">
		We could not verify your Zopim account. Please check your password and try again.
		</div>
	</div>
	 </div>';
        } else {
            $authenticated = "ok";
        }
    }
    if ($authenticated == "ok") {
        if ($accountDetails->package_id == "trial") {
            $accountDetails->package_id = "Free Lite Package + 14 Days Full-features";
        } else {
            $accountDetails->package_id .= " Package";
        }
        ?>
<div id="icon-options-general" class="icon32"><br/></div><h2>Set up your Zopim Account</h2>
<br/>
<div style="background:#FFFEEB;padding:25px;border:1px solid #eee;">
<span style="float:right;"><a href="admin.php?page=zopim_account_config&action=deactivate">Deactivate</a></span>
Currently Activated Account &rarr; <b><?php 
        echo get_option('zopimUsername');
        ?>
</b> <div style="display:inline-block;margin-left:5px;background:#444;color:#fff;font-size:10px;text-transform:uppercase;padding:3px 8px;-moz-border-radius:5px;-webkit-border-radius:5px;"><?php 
        echo ucwords($accountDetails->package_id);
        ?>
</div>
<!--<br><p><br>You can <a href="admin.php?page=zopim_customize_widget">customize</a> the chat widget, or <a href="admin.php?page=zopim_dashboard">launch the dashboard</a> for advanced features.-->
<br><br>To start using Zopim chat, launch our dashboard for access to all features, including widget customization!
<br><br><a href="<?php 
        echo ZOPIM_DASHBOARD_LINK . "&username="******" style="text-decoration:none;" target="_blank" data-popup="true"><div class="zopim_btn_orange">Launch Dashboard</div></a>&nbsp;&nbsp;(This will open up a new browser tab)


<form method="post" action="admin.php?page=zopim_account_config">
	<?php 
        if (isset($_POST['widget-options'])) {
            $opts = $_POST['widget-options'];
            update_option('zopimWidgetOptions', $opts);
            echo '<i>Widget options updated.<br/></i>';
        }
        ?>
	<p>
	Optional code for customization with Zopim API:
	<br/>
	<textarea name="widget-options" style="width:680px; height: 200px;"><?php 
        echo esc_textarea(zopim_get_widget_options());
        ?>
</textarea>
	<br/>
	<input class="button-primary" type="submit" value="Update widget options" />
	</p>
</form>

</div>
<?php 
    } else {
        ?>
<div id="icon-options-general" class="icon32"><br/></div><h2>Set up your Zopim Account</h2>
<?php 
        if (isset($error["auth"])) {
            echo $error["auth"];
        } else {
            if ($message == "") {
                ?>
Congratulations on successfully installing the Zopim WordPress plugin!<br>
<br>
<?php 
            } else {
                echo $message;
            }
        }
        ?>
<div id="existingform">
	<div class="metabox-holder">
		<div class="postbox">
			<h3 class="hndle"><span>Link up with your Zopim account</span></h3>
			<div style="padding:10px;">
<?php 
        if (isset($error["login"])) {
            echo '<span class="error">' . $error["login"] . '</span>';
        }
        ?>
<form method="post" action="admin.php?page=zopim_account_config">
	<input type="hidden" name="action" value="login">
	<table class="form-table">

			<tr valign="top">
			<th scope="row">Zopim Username (E-mail)</th>
			<td><input type="text" name="zopimUsername" value="<?php 
        echo get_option('zopimUsername');
        ?>
" /></td>
			</tr>

			<tr valign="top">
			<th scope="row">Zopim Password</th>
			<td><input type="password" name="zopimPassword" value="" /></td>
			</tr>

			<!--<tr valign="center">
			<th scope="row">Use SSL</th>
			<td><input type="checkbox" name="zopimUseSSL" value="zopimUseSSL" <?php 
        if (get_option('zopimUseSSL') == "zopimUseSSL") {
            echo "checked='checked'";
        }
        ?>
 /> uncheck this if you are unable to login</td>
			</tr>-->
	 </table>
		<br/>
		The Zopim chat widget will display on your blog after your account is linked up.
		<br/>
		<p class="submit">
		<input id="linkup" type="submit" onclick="animateButton()" class="button-primary" value="<?php 
        _e('Link Up');
        ?>
" />
		&nbsp;Don't have a Zopim account? <a href="<?php 
        echo ZOPIM_SIGNUP_REDIRECT_URL;
        ?>
" target="_blank" data-popup="true">Sign up now</a>.
		</p>

</form>

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

</div>


<?php 
    }
}
Example #3
0
function zopim_customize_widget()
{
    global $current_user;
    $ul = $current_user->data->first_name;
    $useremail = $current_user->data->user_email;
    $greetings = json_to_array(get_option('zopimGreetings'));
    $message = "";
    if (count($_POST) > 0) {
        update_option('zopimLang', $_POST["zopimLang"]);
        update_option('zopimPosition', $_POST["zopimPosition"]);
        update_option("zopimBubbleEnable", $_POST["zopimBubbleEnable"]);
        update_option('zopimColor', $_POST["zopimColor"]);
        update_option('zopimTheme', $_POST["zopimTheme"]);
        update_option('zopimBubbleTitle', stripslashes($_POST["zopimBubbleTitle"]));
        update_option('zopimBubbleText', stripslashes($_POST["zopimBubbleText"]));
        update_checkbox("zopimGetVisitorInfo");
        update_checkbox("zopimHideOnOffline");
        update_checkbox("zopimUseGreetings");
        update_checkbox("zopimUseBubble");
        if (isset($_POST['zopimUseGreetings']) && $_POST['zopimUseGreetings'] != "") {
            $greetings->online->window = stripslashes($_POST["zopimOnlineLong"]);
            $greetings->online->bar = stripslashes($_POST["zopimOnlineShort"]);
            $greetings->away->window = stripslashes($_POST["zopimAwayLong"]);
            $greetings->away->bar = stripslashes($_POST["zopimAwayShort"]);
            $greetings->offline->window = stripslashes($_POST["zopimOfflineLong"]);
            $greetings->offline->bar = stripslashes($_POST["zopimOfflineShort"]);
            update_option('zopimGreetings', to_json($greetings));
        }
        $message = "<b>Changes saved!</b><br>";
    }
    zopimme();
    $accountDetails = getAccountDetails(get_option('zopimSalt'));
    if (get_option('zopimCode') == "zopim") {
        $message = '<div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>Customizing in Demo Mode</span></h3>
		<div style="padding:10px;line-height:17px;">
			Currently customizing in demo mode. Messages in this widget will go to Zopim staff. The chat widget will not appear on your site until you <a href="admin.php?page=zopim_account_config">activate / link up an account</a>. <br>
		</div>
	</div>
		</div>';
        $accountDetails->widget_customization_enabled = 1;
        $accountDetails->color_customization_enabled = 1;
    } else {
        if (isset($accountDetails->error)) {
            $message = '<div class="metabox-holder">
								<div class="postbox">
								<h3 class="hndle"><span>Account no longer linked!</span></h3>
								<div style="padding:10px;line-height:17px;">
									We could not connect to your Zopim account. As a result, this customization page is running in demo mode.<br> Please <a href="admin.php?page=zopim_account_config">check your password in account setup</a> and try again.
								</div>
								</div>
								</div>';
        } else {
            $message .= "Click 'Save Changes' when you're done. Happy customizing!";
        }
    }
    // unset($accountDetails->widget_customization_enabled);
    // unset($accountDetails->color_customization_enabled);
    ?>

	<script type="text/javascript">

	function updateWidget() {
		var lang = document.getElementById('zopimLang').options[ document.getElementById('zopimLang').options.selectedIndex ].value;
		$zopim.livechat.setLanguage(lang);

		if (document.getElementById("zopimGetVisitorInfo").checked) {
			$zopim.livechat.setName('<?php 
    echo $ul;
    ?>
');
			$zopim.livechat.setEmail('<?php 
    echo $useremail;
    ?>
');
		}
		else {
			$zopim.livechat.setName('Visitor');
			$zopim.livechat.setEmail('');
		}

		document.getElementById("zopimHideOnOffline").checked? $zopim.livechat.button.setHideWhenOffline(true): $zopim.livechat.button.setHideWhenOffline(false);

		$zopim.livechat.window.setColor(document.getElementById("zopimColor").value);
		$zopim.livechat.window.setTheme(document.getElementById("zopimTheme").value);

		if (document.getElementById("zopimUseBubble").checked) {
			$zopim.livechat.bubble.setTitle(document.getElementById("zopimBubbleTitle").value);
			$zopim.livechat.bubble.setText(document.getElementById("zopimBubbleText").value);
		}
		else {
			$zopim.livechat.bubble.setTitle('Questions?');
			$zopim.livechat.bubble.setText('Click here to chat with us!');
		}

		$zopim.livechat.setGreetings({
			'online':  [document.getElementById("zopimOnlineShort").value, document.getElementById("zopimOnlineLong").value],
			'offline': [document.getElementById("zopimOfflineShort").value, document.getElementById("zopimOfflineLong").value],
			'away':    [document.getElementById("zopimAwayShort").value, document.getElementById("zopimAwayLong").value]
		});
	}

	function updatePosition() {
		var position = document.getElementById('zopimPosition').options[ document.getElementById('zopimPosition').options.selectedIndex ].value;
		$zopim.livechat.button.setPosition(position);
	}

	function updateBubbleStatus() {
		var value = document.getElementById("zopimBubbleEnable").value;
		switch (value) {
			case 'default':
				$zopim.livechat.bubble.reset();
				break;
			case 'show':
				$zopim.livechat.bubble.show();
				break;
			case 'hide':
				$zopim.livechat.bubble.hide();
				break;
		}
	}

	function greetingsChanged() {
		var inputs     = [ 'zopimOnlineShort', 'zopimAwayShort', 'zopimOfflineShort',
											 'zopimOnlineLong' , 'zopimAwayLong', 'zopimOfflineLong' ];
		var isDisabled = false;

		document.getElementById('zopimUseGreetings').checked? (isDisabled = false): (isDisabled = true);

		for (var i=0; i<inputs.length; i++) {
			document.getElementById(inputs[i]).disabled = isDisabled;
		}

		updateWidget();
	}

	function bubbleChanged() {
		var inputs     = [ 'zopimBubbleTitle', 'zopimBubbleText' ];
		var isDisabled = false;

		document.getElementById('zopimUseBubble').checked? (isDisabled = false): (isDisabled = true);

		for (var i = 0; i < inputs.length; i++) {
			document.getElementById(inputs[i]).disabled = isDisabled;
		}

		updateWidget();
	}

	var timer;
	function updateSoon() {
		clearTimeout(timer);
		timer = setTimeout("updateWidget()", 300);
	}

	</script>

<style type="text/css">
.smallExplanation {
background:#FAFAFA;
color:#667788;
font-size:8pt;
line-height:13px;
margin:4px 0 0 0;
padding:8px;
display: inline-block;
}
.inputtextshort {
width:200px;
}
.inputtext {
width:450px;
}
.secthead {
border-bottom:1px solid #EEEEEE;
color:#8899AA;
font-size:13px;
line-height:21px;
}
.sethead {
	width:200px;
}
.swatch {
	float: left;
	width: 15px
}
.swatch:hover {
	background-image:url(http://www.zopim.com/static/images/colorselectbg.gif);
	cursor:pointer;
}
.sorry {
	color:#c33;
}
</style>

<div class="wrap">
<div id="icon-themes" class="icon32"><br/></div><h2>Customize your widget</h2>

<?php 
    echo $message;
    ?>
<form method="post" action="admin.php?page=zopim_customize_widget">
<div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>General Settings</span></h3>
		<div style="padding:10px;">
		<table class="form-table">
			<tr valign="top">
				<th scope="row" class="sethead">Language</th>
				<td>
					<select name="zopimLang" id="zopimLang" onchange="updateWidget()">
<?php 
    $languages = get_languages();
    echo generate_options($languages, get_option('zopimLang'));
    ?>
				</select>
				</td>
				</tr>
				<tr valign="top" style="display:none;">
				<th scope="row">Use Logged in Username / Email</th>
				<td><input onchange="updateWidget()" type="checkbox" id="zopimGetVisitorInfo" name="zopimGetVisitorInfo" value="zopimGetVisitorInfo" <?php 
    if (get_option('zopimGetVisitorInfo') != "disabled") {
        echo "checked='checked'";
    }
    ?>
 /></td>
				</tr>
				<tr valign="top">
				<th scope="row" class="sethead">Position</th>
				<td>

				<select name="zopimPosition" id="zopimPosition" onchange="updatePosition()">
<?php 
    $positions = array("br" => "Bottom Right", "bl" => "Bottom Left");
    echo generate_options($positions, get_option('zopimPosition'));
    ?>
				</select>
				</td>
				</tr>

				<tr valign="top">
				<th scope="row">Hide chat bar when offline<br>
				<!-- <div class="smallExplanation">Hide the chat bar when no agents are available to answer questions. This prevents visitors from sending you offline messages. </div>  -->
				</th>
					<td>
						<input onchange="updateWidget()" type="checkbox" id="zopimHideOnOffline" name="zopimHideOnOffline" value="zopimHideOnOffline" <?php 
    if (get_option('zopimHideOnOffline') && get_option('zopimHideOnOffline') != "disabled") {
        echo "checked='checked'";
    }
    ?>
 /> Prevents visitors from sending you offline messages
						<a href="#" onclick="$zopim.livechat.button.show();return false">(Show preview chat bar)</a>
					</td>
				</tr>
		</table>
		</div>
	</div>
</div>
<div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>Color & Theme Settings</span></h3>
		<div style="padding:10px;">
		Theme settings show up instantly on the preview widget. Try it out!<br/>
		<table class="form-table" style="width: 700px">
				<tr valign="top">
				<td colspan="2">
				<input type="hidden" id="zopimColor" name="zopimColor" value="<?php 
    echo get_option('zopimColor');
    ?>
">
<?php 
    if ($accountDetails->color_customization_enabled == 1) {
        echo "<div style='display:inline-block;border:11px solid #888;background:#888;color:#fee;'>";
        $colors = curl_get_url(ZOPIM_COLORS_LIST);
        $colors = explode("\n", $colors);
        $i = 0;
        foreach ($colors as $color) {
            echo "<div class='swatch' style='background-color: {$color};' onclick=\"document.getElementById('zopimColor').value='{$color}'; updateWidget();\">&nbsp</div>";
            if (++$i % 40 == 0) {
                echo "<br>";
            }
        }
        echo "<br><a href=# style='color:#ff8' onclick=\"document.getElementById('zopimColor').value=''; updateWidget();\">Restore default color</a></div>";
    } else {
        echo "<div class='sorry'>Sorry, your plan does not allow for color customization. Please upgrade to enjoy choice of color!</div>";
    }
    ?>
				</td>
				</tr>
				<tr valign="top">
				<th scope="row" class="sethead">Select A Theme</th>
				<td style="width: 400px"><div align="left">
<?php 
    if ($accountDetails->widget_customization_enabled == 1) {
        echo '<select name="zopimTheme" id="zopimTheme" onchange="updateWidget()">';
        $themes = curl_get_url(ZOPIM_THEMES_LIST);
        $themes = valuekeys(explode("\n", $themes));
        ksort($themes);
        echo generate_options($themes, get_option('zopimTheme'));
        echo "</select> <a href='#' onclick='\$zopim.livechat.window.toggle();return false;'>Open the chat panel</a> to see changes";
    } else {
        echo "<div class='sorry'>Sorry, your plan does not allow for theme customization. Please upgrade to enjoy choice of themes!</div>";
        echo '<input type=hidden value="" name="zopimTheme" id="zopimTheme">';
    }
    ?>
				</td>
				</tr>
		</table>
		</div>
	</div>
</div>

<?php 
    get_option('zopimUseBubble') && get_option('zopimUseBubble') != "disabled" ? $useBubble = true : ($useBubble = false);
    ?>
<div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>Help Bubble Settings</span></h3>
		<div style="padding:10px;">
		<table class="form-table">
			<tr valign="top">
				<th scope="row">Display Help Bubble<br></th>
				<td><select onchange="updateBubbleStatus()" type="checkbox" id="zopimBubbleEnable" name="zopimBubbleEnable"> <?php 
    $bubble_modes = array("default" => "Let user decide", "show" => "Always show", "hide" => "Always hide");
    echo generate_options($bubble_modes, get_option('zopimBubbleEnable'));
    ?>
	</select>
			</tr>
			<tr>
				<td colspan="2"><div class="secthead">Help Bubble Text</div></td>
			</tr>
			<tr>
				<td colspan="2"><input type="checkbox" id="zopimUseBubble" onchange="bubbleChanged()" value="zopimUseBubble" name="zopimUseBubble" <?php 
    if ($useBubble) {
        echo "checked='checked'";
    }
    ?>
/> Enable help bubble text settings (override dashboard settings) - save settings to view changes.</td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Help Bubble Title</th>
				<td><input class="inputtextshort" name="zopimBubbleTitle" id="zopimBubbleTitle" onKeyup="updateSoon()" value="<?php 
    echo get_option('zopimBubbleTitle');
    ?>
"  <?php 
    if (!$useBubble) {
        echo "disabled='disabled'";
    }
    ?>
><!-- <a href="#" onclick="updateBubbleStatus();">Refresh</a></td> -->
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Help Bubble Message</th>
				<td><input class="inputtext" name="zopimBubbleText" id="zopimBubbleText" onKeyup="updateSoon()" value="<?php 
    echo get_option('zopimBubbleText');
    ?>
"  <?php 
    if (!$useBubble) {
        echo "disabled='disabled'";
    }
    ?>
></td>
			</tr>
		</table>
		</div>
	</div>
</div>

<?php 
    get_option('zopimUseGreetings') && get_option('zopimUseGreetings') != "disabled" ? $useGreetings = true : ($useGreetings = false);
    ?>
<div class="metabox-holder">
	<div class="postbox">
		<h3 class="hndle"><span>Greeting Message Settings</span></h3>
		<div style="padding:10px;">
		<table class="form-table">
			<tr>
				<td colspan="2"><input type="checkbox" id="zopimUseGreetings" onchange="greetingsChanged()" value="zopimUseGreetings" name="zopimUseGreetings" <?php 
    if ($useGreetings) {
        echo "checked='checked'";
    }
    ?>
/>	Enable greeting message settings (override dashboard settings) </td>
			</tr>
			<tr>
				<td colspan="2"><div class="secthead">Message Shown on Chat Bar (max 26 characters)</div></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Online</th>
				<td><input class="inputtextshort" name="zopimOnlineShort" id="zopimOnlineShort" onKeyup="updateSoon()" value="<?php 
    echo $greetings->online->bar;
    ?>
" <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
 maxlength="26"></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Away</th>
				<td><input class="inputtextshort" name="zopimAwayShort" id="zopimAwayShort" onKeyup="updateSoon()"  value="<?php 
    echo $greetings->away->bar;
    ?>
"  <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
  maxlength="26"></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Offline</th>
				<td><input class="inputtextshort" name="zopimOfflineShort" id="zopimOfflineShort" onKeyup="updateSoon()" value="<?php 
    echo $greetings->offline->bar;
    ?>
" <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
  maxlength="26"></td>
			</tr>
			<tr>
				<td colspan="2"><div class="secthead">Message Shown on Chat Panel (max 140 characters)</div></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Online</th>
				<td><textarea class="inputtext" name="zopimOnlineLong" id="zopimOnlineLong" onKeyup="updateSoon()"  <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
 ><?php 
    echo $greetings->online->window;
    ?>
</textarea></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Away</th>
				<td><textarea class="inputtext" name="zopimAwayLong" id="zopimAwayLong" onKeyup="updateSoon()" <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
 ><?php 
    echo $greetings->away->window;
    ?>
</textarea></td>
			</tr>
			<tr valign="top">
				<th scope="row" class="sethead">Offline</th>
				<td><textarea class="inputtext" name="zopimOfflineLong" id="zopimOfflineLong" onKeyup="updateSoon()"  <?php 
    if (!$useGreetings) {
        echo "disabled='disabled'";
    }
    ?>
 ><?php 
    echo $greetings->offline->window;
    ?>
</textarea></td>
			</tr>
		</table>
		</div>
	</div>
</div>

<p class="submit">
	<input type="submit" class="button-primary" value="<?php 
    _e('Save Changes');
    ?>
" />
</p>

</form>
</div>

<?php 
}
Example #4
0
function sendMailToEntrepreneur($fullName, $email, $amount, $username)
{
    global $pmode;
    $from_address = FROM_EMAIL_ADDRESS;
    $bcc_address = SIVI_ADMIN_EMAIL;
    global $funding_for, $pledged, $pledgegoal;
    $so_far_pledged = $pledged + $amount;
    $server = 'http://' . $_SERVER['HTTP_HOST'];
    list($first_name, $last_name, $user_id, $email) = getAccountDetails($username);
    $to = $email;
    $name_of_project = getProjectName($user_id);
    #$name_of_campaign
    #$subject = "New Donation Alert! $fullName Just Pledged \$$amount USD to $name_of_project on LaunchLeader";
    $subject = "New Donation Alert! {$fullName} Just Pledged \${$amount} USD to your project on LaunchLeader";
    $message = "<html><body>\nHi {$first_name},<br> \n<br>\nGood news! {$fullName} just donated to {$funding_for} for <a href=\"{$server}/profile/{$username}?pmode={$pmode}\">{$name_of_project}</a> <br>\n<br>\nAmount pledged: \${$amount} USD<br>\n<br>\nNow \${$so_far_pledged} USD is currently pledged toward your \${$pledgegoal} USD goal.<br>\n<br>\nRemember that you must reach your campaign goal by the deadline in order to receive any funding.<br>\n<br>\nGo to your <a href=\"{$server}/login?pmode={$pmode}\">project page dashboard</a> to review activity, engage your donors and continue promoting your<br>\ncampaign.<br>\n<br>\nBest wishes!<br>\n<br>\n The LaunchLeader Team\n</body></html>\n";
    //     'Reply-To: webmaster@example.com' . "\r\n" .
    $headers = "From: {$from_address}" . "\r\n";
    $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
    if ($bcc_address != "") {
        $headers .= "Bcc: {$bcc_address}\r\n";
    }
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    mail($to, $subject, $message, $headers);
}
Example #5
0
function sendDeclinedMailToEntrepreneur($funding_details_id, $fund_amount, $funder_id)
{
    $from_address = FROM_EMAIL_ADDRESS;
    $cc_address = SIVI_ADMIN_EMAIL;
    global $eID, $aID, $application_fee;
    $stripe_fee = 3 + $application_fee;
    $server = '//' . $_SERVER['HTTP_HOST'];
    list($first_name, $last_name, $username, $email, $pmode) = getAccountDetails($aID);
    $campaign_name = getCampaignName($eID);
    list($funder_name, $email) = getFullName($funder_id);
    $to = $email;
    $name_of_project = getProjectName($aID);
    #$name_of_campaign
    $subject = "Unable To Process Funding for Your {$campaign_name} Campaign on LaunchLeader";
    $message = "<html><body>\n    Hi {$first_name},<br>\n    <br>\n    The good news is that your {$campaign_name} for <a href=\"{$server}/profile?u={$username}&pmode={$pmode}\">{$name_of_project}</a> just successfully reached its<br>\n    funding goal on LaunchLeader.<br>\n    <br>\n\n    The bad news is that <br>we are unable to process the following donations because the donor’s credit card has been declined by his/her bank.</b><br>\n    This could be due to a variety of reasons such as changes with the card information or passing the expiration date.<br>\n    <br>\n    -- {$funder_name}, Amount pledged \${$fund_amount} USD<br>\n\n    <br>\n    Thanks,<br>\n    <br>\n    The LaunchLeader Team\n    </body></html>\n    ";
    //     'Reply-To: webmaster@example.com' . "\r\n" .
    $headers = "From: {$from_address}" . "\r\n";
    $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
    if ($cc_address != "") {
        $headers .= "CC: {$cc_address}\r\n";
    }
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    mail($to, $subject, $message, $headers);
}
Example #6
0
						</li>				
					</ul>
				</div><!-- /.nav -->
				
			</div><!-- /.header-inner clearfix -->
		</div><!-- /.shell -->
	</div><!-- /.header -->
<div class="main">
<br><br>

<?php 
$result = mysql_query("select account_id, funder_id  from conversation_track where conversation_track_token='{$key}' ") or die("mysql error @ line # 13");
$row = mysql_fetch_row($result);
$account_id = $row[0];
$funder_id = $row[1];
list($first_name, $last_name, $username) = getAccountDetails($account_id);
list($funder_name, $funder_email) = getFunderDetails($funder_id);
$entrepreneur_name = "{$first_name} {$last_name}";
function getAccountDetails($account_id)
{
    $result = mysql_query("select account_name_first,account_name_last, account_username from account where account_id ='{$account_id}'") or die("mysql error@ getAccountDetails");
    $row = mysql_fetch_row($result);
    $first_name = $row[0];
    $last_name = $row[1];
    $username = $row[2];
    return array($first_name, $last_name, $username);
}
function getFunderDetails($account_funder_id)
{
    $result = mysql_query("select account_funder_name,account_funder_email from account_funder where account_funder_id='{$account_funder_id}'") or die("mysql error@ finding customer @ line getFullName");
    $row = mysql_fetch_row($result);
function zopimlivechat_output($vars)
{
    $modulelink = $vars['modulelink'];
    $LANG = $vars['_lang'];
    $error = false;
    $q = @mysql_query("SELECT * FROM tbladdonmodules WHERE module = 'zopimlivechat'");
    while ($arr = mysql_fetch_array($q)) {
        $settings[$arr['setting']] = $arr['value'];
    }
    echo '<p>' . $LANG['intro'] . '</p>';
    echo '<p>' . $LANG['description'] . '</p>';
    echo '<p>' . $LANG['documentation'] . '</p>';
    if (!$settings['z_user'] or !$settings['z_pass']) {
        echo 'Please use the Configure Addons page <a href=\\"configaddonmods.php\\">here</a>.';
        $error = true;
    } else {
        $table = "mod_zopimlivechat";
        $fields = "salt";
        $where = "";
        $result = select_query($table, $fields, $where);
        $data = mysql_fetch_array($result);
        if (!$data['salt']) {
            $logindata = array("email" => $settings['z_user'], "password" => $settings['z_pass']);
            $loginresult = json_to_array(do_post_request(ZOPIM_LOGIN_URL, $logindata));
            if (isset($loginresult->error)) {
                echo "<b>Could not log in to Zopim. Please check your login details. If problem persists, try connecting without SSL enabled.</b>";
                $error = true;
            } else {
                $account = getAccountDetails($loginresult->salt);
                if (isset($account)) {
                    $table = "mod_zopimlivechat";
                    if (!$data['user']) {
                        $values = array("user" => $settings['z_user'], "key" => $account->account_key, "salt" => $loginresult->salt);
                        $newid = insert_query($table, $values);
                    } else {
                        $update = array("key" => $account->account_key, "salt" => $loginresult->salt);
                        $where = array("user" => $settings['z_user']);
                        update_query($table, $update, $where);
                    }
                } else {
                    echo "<b>Could not log in to Zopim. We were unable to contact Zopim servers. Please check with your server administrator to ensure that <a href='http://www.php.net/manual/en/book.curl.php'>PHP Curl</a> is installed and permissions are set correctly.</b>";
                    $error = true;
                }
            }
        }
        if (!$error) {
            echo "Thanks for using Zopim Live Chat with WHMCS, copy code below and paste before the closing &lt;/body&gt; tag of the page.";
            $q2 = @mysql_query("SELECT * FROM mod_zopimlivechat WHERE user = '******'z_user'] . "' ");
            $arr2 = mysql_fetch_array($q2);
            $code = $arr2['key'];
            $scripts = "<!--Start of Zopim Live Chat Script-->\n<script type=\"text/javascript\">\nwindow.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},\$=z.s=\nd.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.\n_.push(o)};z._=[];z.set._=[];\$.async=!0;\$.setAttribute('charset','utf-8');\n\$.src='//cdn.zopim.com/?" . $code . "';z.t=+new Date;\$.\ntype='text/javascript';e.parentNode.insertBefore(\$,e)})(document,'script');\n</script>\n<!--End of Zopim Live Chat Script-->";
            echo "<textarea cols='100' rows='10'>";
            echo $scripts;
            echo "</textarea>";
        }
    }
}