public function action_index() { if ($_POST) { $message = html::chars((string) arr::get($_POST, 'message', '')); if ($message) { // Append user information if ($user = $this->auth->get_user()) { $message .= '<h2>Användarinfo</h2>'; $message .= '<dl>'; foreach (array('id', 'username', 'email') as $field) { $message .= sprintf('<dt>%s</dt><dd>%s</dd>', $field, html::chars($user->{$field})); } $message .= '</dl>'; } $from = arr::extract($_POST, array('e-mail', 'name')); if (!Validate::email($from['e-mail'])) { $from['name'] .= " ({$from['e-mail']})"; $from['e-mail'] = '*****@*****.**'; } $sent = Email::send('*****@*****.**', array($from['e-mail'], $from['name']), '[Änglarna Stockholm] Meddelande från kontaktsidan', $message, TRUE); if ($sent >= 1) { $this->message_add('Ditt meddelande har skickats till ' . html::mailto('*****@*****.**') . '!'); } else { $this->message_add('Något blev fel. Försök igen eller skicka ett vanligt mail till ' . html::mailto('*****@*****.**') . ' istället.', 'error'); } } else { $this->message_add('Du måste ange ett meddelande.', 'error'); } $this->request->reload(); } $this->template->title = 'Kontakta Änglarna Stockholm'; $this->template->content = View::factory('kontakt/index'); }
/** * get contact information. * * @access public * @return string */ public function getContact() { $contact = json_decode($this->config->company->contact); foreach ($contact as $item => $value) { if ($value) { if ($item == 'qq') { $contact->qq = html::a("http://wpa.qq.com/msgrd?v=3&uin={$value}&site={$this->config->company->name}&menu=yes", $value, "target='_blank'"); } else { if ($item == 'email') { $contact->email = html::mailto($value, $value); } else { if ($item == 'weibo') { $contact->weibo = html::a("http://weibo.com/{$value}", $value, "target='_blank'"); } else { if ($item == 'site') { if ($_SERVER['HTTP_HOST'] != $value) { $contact->site = html::a("http://{$value}", $value, "target='_blank'"); } if ($_SERVER['HTTP_HOST'] == $value) { unset($contact->{$item}); } } else { if ($item == 'wangwang') { $contact->wangwang = html::a("http://www.taobao.com/webww/ww.php?ver=3&touid={$value}&siteid=cntaobao&status=2&charset=utf-8", $value, "target='_blank'"); } else { if ($item == 'phone') { $values = explode(',', $value); $mobile = $this->app->loadClass('mobile'); $phones = array(); foreach ($values as $value) { if ($mobile->isMobile()) { $phones[] = html::a("tel:{$value}", $value); } else { $phones[] = $value; } } $contact->phone = join('<br/>', $phones); } } } } } } } else { unset($contact->{$item}); } } return $contact; }
<th scope="col">first name</th> <th scope="col">last name</th> <th scope="col">role</th> <th scope="col" class="stdtable-hr"> </th> </tr> <?php $i = 0; foreach ($query->result_array() as $user) { ?> <tr class="center <?php echo $i % 2 == 0 ? 'odd' : 'even'; ?> "> <td><?php echo html::mailto($user->email, $user->identity, array('class' => 'blue')); ?> </td> <td><?php echo $user->first_name; ?> </td> <td><?php echo $user->last_name; ?> </td> <td><?php echo $user->role; ?> </td> <td>
<div id="contact"> <h1 class="intro">If you want more information about the services that <em>w.ings consulting</em> can provide for your business, or if you have comments about this website, please <?php echo html::mailto('*****@*****.**', 'email me'); ?> . If you are considering hiring me for a project, please use the contact form below.</h1> <div class="span-14 suffix-4 colborder"> <h2>Send Me A Lead</h2> <p class="byline">Please allow a day or two for me to review your information and send a response.</p> <?php echo $content; ?> </div> </div>
<div class="box"> <h1>Mediagalleriet</h1> <p> Här samlar vi bilder från både matcher och änglamöten. Sitter du och trycker på lite bilder? Skicka dem till oss på <?php echo html::mailto('*****@*****.**'); ?> ! </p> <?php if (!empty($galleries)) { ?> <ol class="gallery galleries"> <?php foreach ($galleries as $gallery) { ?> <li><a href="<?php echo url::site(Route::get('gallery')->uri(array('galleri' => $gallery->path))); ?> "><?php echo html::chars($gallery->path); ?> (<?php echo $gallery->images; ?> bilder)</a></li> <?php } ?> </ol> <?php
<dd> <span><?php echo $lang->contact->{$item}; ?> </span> <?php $site = isset($config->company->name) ? $config->company->name : ''; ?> <?php if ($item == 'qq') { echo html::a("http://wpa.qq.com/msgrd?v=3&uin={$contact->{$item}}&site={$site}&menu=yes", $contact->{$item}, "target='_blank'"); } ?> <?php if ($item == 'email') { echo html::mailto($contact->{$item}, $contact->{$item}); } ?> <?php if ($item != 'qq' and $item != 'email') { echo $contact->{$item}; } ?> </dd> <?php } ?> <?php } ?> </dl>
echo html::style('media/css/site.css'); ?> </head> <body> <div class="logo"> <div class="logo_name"><?php echo $title; ?> </div> <div class="logo_text"><?php echo $description; ?> </div> <div class="logo_contacts"> <b>Электронная почта:</b> <?php echo html::mailto('*****@*****.**'); ?> </div> </div> <div style="float: left;"> <div class="category"> <div class="category_title">Категории</div> <ul> <?php foreach ($main_categories as $category) { echo '<li>' . html::anchor('category/' . $category->url . '-' . $category->id, $category->name) . '</li>'; } ?> </ul> </div> <div style="clear: left;"></div>
<?php $companyName = isset($config->company->name) ? $config->company->name : ''; ?> <?php if ($contact->phone or $contact->mobile) { echo "<div><i class='icon-phone-sign'></i> {$contact->phone} {$contact->mobile}</div>"; } ?> <?php if ($contact->qq) { echo "<div class='f-14'><i class='icon-qq'></i> " . html::a("http://wpa.qq.com/msgrd?v=3&uin={$contact->qq}&site={$companyName}&menu=yes", $contact->qq, "target='_blank'") . "</div>"; } ?> <?php if ($contact->email) { echo "<div class='f-14'><i class='icon-envelope-alt'></i> " . html::mailto($contact->email, $contact->email) . "</div>"; } ?> </div> <p class='vcard text-center'><?php echo html::image(helper::createLink('contact', 'vcard', "contactID={$contact->id}"), "style='height:120px'"); ?> </p> </div> <div class='col-sm-2'> <div class='text-right'><i class='btn-vcard icon icon-qrcode icon-large'> </i></div> </div> </div> </td> </tr> </table>
?> " class="inputbox input-text" type="text" maxlength="50" /> </p> <p class="form-line"> <label for="password" class="form-label"><?php echo Kohana::lang('user.password'); ?> :</label> <input name="password" id="password" value="" class="inputbox input-text" type="text" maxlength="50" /> </p> <p class="form-line"> <label for="email" class="form-label"><?php echo Kohana::lang('user.mail'); ?> : <span><?php echo html::mailto($row->email, Kohana::lang('form.write')); ?> </span></label> <input name="email" id="email" value="<?php echo $row->email; ?> " class="inputbox input-text" type="text" /> </p> <p class="form-line"> <label for="ip" class="form-label"><?php echo Kohana::lang('user.ip'); ?> :</label> <input name="ip" id="ip" value="<?php echo $row->ip; ?>
<td class='text-left'><?php if (isset($customers[$contact->customer])) { echo html::a($this->createLink('provider', 'view', "customerID={$contact->customer}"), $customers[$contact->customer]); } ?> </td> <td><?php echo isset($lang->genderList->{$contact->gender}) ? $lang->genderList->{$contact->gender} : ''; ?> </td> <td class='text-left'><?php echo $contact->phone . ' ' . $contact->mobile; ?> </td> <td><?php echo html::mailto($contact->email, $contact->email); ?> </td> <td class='visible-lg'><?php echo empty($contact->qq) ? '' : html::a("tencent://Message/?Uin={$contact->qq}&websiteName=RanZhi&Menu=yes", $contact->qq, "target='_blank'"); ?> </td> <td class='operate'> <?php commonModel::printLink('contact', 'edit', "contactID={$contact->id}", $lang->edit); commonModel::printLink('contact', 'vcard', "contactID={$contact->id}", $lang->contact->qrcode, "class='iframe' data-width='400' data-icon='qrcode' data-height='440'"); commonModel::printLink('contact', 'delete', "contactID={$contact->id}", $lang->delete, "class='reloadDeleter'"); ?> </td> </tr> <?php
<div id="content" class="span-22 prefix-1 suffix-1 last"> <?php echo !empty($messages) ? $messages : ''; echo $content; ?> </div> <div id="footer" class="span-24"> <div class="vcard"> <ul> <li class="fn org"><?php echo html::anchor('', 'w.ings consulting', array('class' => 'url')); ?> </li> <li class="email"><?php echo html::mailto('*****@*****.**', 'Email Me'); ?> </li> <li class="twitter"><?php echo html::anchor('http://twitter.com/shadowhand', 'Follow Me'); ?> </li> <li class="copyright"><small>Copyright © 2009</small></li> </ul> <p>Web Development in <span class="adr"><span class="locality">Grand Marais</span> | Duluth | Minneapolis, <span class="region">Minnesota</span></span></p> <p><small>Rendered in {execution_time} by <?php echo html::anchor('http://kohanaphp.com/', 'KohanaPHP'); ?> on <?php echo html::anchor('http://webfaction.com/?affiliate=wgilk', 'webfaction'); ?>
/** * Converts text email addresses into links. Existing links will not * be altered. * * echo \Test::auto_link_emails($text); * * [!!] This method is not foolproof since it uses regex to parse HTML. * * @param string text to auto link * @return string * @uses html::mailto */ public static function auto_link_emails($text) { $auto_link_emails_callback = function ($matches) { return \html::mailto($matches[0]); }; // Find and replace all email addresses that are not part of an existing html mailto anchor // Note: The "58;" negative lookbehind prevents matching of existing encoded html mailto anchors // The html entity for a colon (:) is : or : or : etc. return \preg_replace_callback('~\\b(?<!href="mailto:|58;)(?!\\.)[-+_a-z0-9.]++(?<!\\.)@(?![-.])[-a-z0-9.]+(?<!\\.)\\.[a-z]{2,6}\\b(?!</a>)~i', $auto_link_emails_callback, $text); }
<h2>Интернет магазин Sea Gifts</h2> <p> <b>Email:</b> <?php echo html::mailto('*****@*****.**'); ?> <br /> <b>Телефон:</b> +380501234567 <p> <b>УСЛОВИЯ ДОСТАВКИ</b> <p> <ol> <li>Черемушки, Центр, Таирова, Фонтан - 15 грн. (бесплатно при заказе на сумму от 250 грн).</li> <li>пос. Котовского - 25грн. (бесплатно при заказе на сумму от 300 грн).</li> <li>город Ильичевск и пригород - 30грн (бесплатно при заказе на сумму от 350 грн).</li> </ol>
foreach ($content as $data) { if (!empty($data->photo)) { $photo = html::anchor('upload/' . $data->photo, html::image('upload/' . $data->photo, array('width' => 50, 'height' => 50, 'alt' => $data->photo))); } else { $photo = 'Нет фото'; } echo '<table border="0" width="60%" align="center">'; echo '<tr valign="top"><td width="25%"><b>Название:</b></td><td width="25%">' . $data->name . '</td><td width="50%" rowspan="4" width="50%"><center><b>Описание:</b></center><br>' . (!empty($data->description) ? nl2br($data->description) : "Нет описания") . '</td></tr>'; echo '<tr valign="top"><td width="25%"><b>Цена (за КГ):</b></td><td width="25%">' . $data->price . ' грн.</td></tr>'; echo '<tr valign="top"><td width="25%" valign="top"><b>Фото:</b></td><td width="25%" valign="top">' . $photo . '</td></tr>'; echo '<tr valign="top"><td width="50%" colspan="2">' . html::anchor('addbasket/' . $data->id, 'Добавить в корзину', array('title' => 'Купить ' . $data->name . ' - ' . $data->price . ' грн. за килограмм')) . '</td></tr>'; echo '</table><hr noshade color="#032c5b" size="1" width="60%" align="center"><p>'; } if ($pagination->total_items != 1) { echo '<hr noshade color="#032c5b" size="5" width="60%" align="center"><center>' . $pagination . '</center>'; } } } ?> </div><!-- [END] content --> <div class="footer"> <p>design & code © <?php echo html::mailto('*****@*****.**', 'm.r.s.a.'); ?> </p> </div> </div><!-- [END] wrapper --> </body> </html>
förutsatt att alla verk som baseras på min kod också släpps under GNU AGPL (och därmed har <em>er</em> källkod tillgänglig). För en full beskrivning av licensvillkoren se ovanstående länk till GNU AGPL. Källkoden för sidan finns på <a href="http://github.com/Burgestrand/Anglarna-Stockholm">github.com/Burgestrand/Anglarna-Stockholm</a> </p> <p> All projekthantering sker via <a href="http://nokahuna.com/projects/10288/">NoKahuna</a>. </p> <h2>Webmaster</h2> <p> Hemsidan är utvecklad av mig, <a href="http://burgestrand.se/post/252543664/kim-burgestrand-me">Kim Burgestrand</a>, helt ideellt, på min fritid. Jag är själv inte intresserad av fotboll, utan jag driver det här som ett hobbyprojekt. Vill man hjälpa till får man gärna slå mig en signal eller maila mig på <?php echo html::mailto('*****@*****.**', '*****@*****.**'); ?> . </p> </div> <div class="box"> <h2>Information om kakor (cookies)</h2> <p> På Änglarna Stockholms hemsida används kakor för att kunna logga in och förbli inloggad. Dessa kakor försvinner när du loggar ut eller stänger ner din webbläsare. </p> <p> Om du inte vill acceptera kakor kan du ställa in din webbläsare så att du automatiskt nekar till lagring av kakor på din dator. Rent praktiskt finns väldigt sällan skäl till varför man skulle
/** * Converts text email addresses into links. * * @param string text to auto link * @return string */ public static function auto_link_emails($text) { // Finds all email addresses that are not part of an existing html mailto anchor // Note: The "58;" negative lookbehind prevents matching of existing encoded html mailto anchors // The html entity for a colon (:) is : or : or : etc. if (preg_match_all('~\\b(?<!href="mailto:|">|58;)(?!\\.)[-+_a-z0-9.]++(?<!\\.)@(?![-.])[-a-z0-9.]+(?<!\\.)\\.[a-z]{2,6}\\b~i', $text, $matches)) { foreach ($matches[0] as $match) { // Replace each email with an encoded mailto $text = str_replace($match, html::mailto($match), $text); } } return $text; }
?> </head> <body> <div class="logo"> <div class="wrapper_header"> <div class="logo_name"><?php echo $title; ?> </div> <div class="logo_text"><?php echo $description; ?> </div> <div class="logo_contacts"> <b>Электронная почта:</b> <?php echo html::mailto('webmaster@localhost'); ?> </div> </div> </div> <div class="wrapper"> <div style="float: left;"> <div class="category"> <p> <div class="category_title"><h3>Категории</h3></div> <ul> <?php foreach ($main_categories as $category) { echo '<li>' . html::anchor('category/' . $category->url . '-' . $category->id, $category->name) . '</li>'; } ?>
?> </p> <div class="sharing_dispinfo"> <ul class="info"> <li class="none-separator">Date Added: <strong><?php echo $sharing_date; ?> </strong></li> <li>Key: <strong><?php echo $sharing_key; ?> </strong></li> </ul> <ul class="info"> <li class="none-separator">Contact: <strong><?php echo html::mailto($sharing_email); ?> </strong></li> <li>Last Access: <strong><?php echo $sharing_dateaccess; ?> </strong></li> </ul> <?php if ($sharing_type == 2) { ?> <ul class="info"> <li class="none-separator">Access Limited To: <strong><?php echo $sharing_limits_array[$sharing_limits]; ?> </strong></li>
</h1> <?php echo $content; ?> <p> <?php echo __('Här är någa förslag som du kan försöka med istället:'); ?> </p> <ul> <?php foreach ($suggestions as $suggestion) { ?> <li><?php echo $suggestion; ?> </li> <?php } ?> </ul> <p> <?php echo __('Om du känner att något saknas som faktiskt bör vara här får du gärna ') . html::mailto('*****@*****.**', __('kontakta oss')); ?> ! </p> </body> </html>
<td><?php if (!common::printLink('user', 'view', "account={$user->account}", $user->realname)) { echo $user->realname; } ?> </td> <td><?php echo $user->account; ?> </td> <td><?php echo $lang->user->roleList[$user->role]; ?> </td> <td><?php echo html::mailto($user->email); ?> </td> <td><?php if (isset($lang->user->genderList[$user->gender])) { echo $lang->user->genderList[$user->gender]; } ?> </td> <td><?php echo $user->phone; ?> </td> <td><?php if ($user->qq) { echo html::a("tencent://message/?uin={$user->qq}", $user->qq);
<?php $companyName = isset($config->company->name) ? $config->company->name : ''; ?> <?php if ($user->phone or $user->mobile) { echo "<dd><i class='icon icon-phone-sign'></i> {$user->phone} {$user->mobile}</dd>"; } ?> <?php if ($user->qq) { echo "<dd><i class='icon icon-qq'></i> " . html::a("http://wpa.qq.com/msgrd?v=3&uin={$user->qq}&site={$companyName}&menu=yes", $user->qq, "target='_blank'") . "</dd>"; } ?> <?php if ($user->email) { echo "<dd><i class='icon icon-envelope-alt'></i> " . html::mailto($user->email, $user->email) . "</dd>"; } ?> <?php if ($user->address) { echo "<dd><i class='icon icon-home'></i> {$user->address} </dd>"; } ?> </dl> </div> <div class='vcard text-center'> <?php echo html::image(inlink('vcard', "user={$user->account}")); ?> </div> </div>