Ejemplo n.º 1
0
  <input type="text" name="q" class="domain" id="domain_input" value="inbedify.com" onclick="clearDomainInput(this);">
  <span class="inbedit"><a href="#" onclick="formSubmit();">with bacon</a>.</span>
  <input type="submit" style="display: none;">
</form>
<p class="cta">Type in any address to WithBaconfy!</p>
</div>
<div class="share">
<div class="share-button tw"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://withbaconfy.com" data-text="&quot;in bed&quot; is not just for fortune cookies anymore: " data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<div class="share-button fb"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://withbaconfy.com" send="true" layout="button_count" width="100" show_faces="false" font=""></fb:like></div>
</div>
<div class="footer">
<p class="credits">Made by <a href="https://twitter.com/benswords" onClick="recordOutboundLink(this, 'Outbound Links', 'twitter.com');return false;">@benswords</a> and <a href="https://twitter.com/ezrabg" onClick="recordOutboundLink(this, 'Outbound Links', 'twitter.com');return false;">@ezrabg</a>. Made tastier by <a href="https://twitter.com/rupl" onClick="recordOutboundLink(this, 'Outbound Links', 'twitter.com');return false;">@rupl</a> with bacon.</p>
<p class="fineprint">This is a novelty service, no ownership over served content is implied &hellip; in bed or with bacon.</p>
</div> 
</body><!-- with bacon -->
</html>
eof;
  exit;
}

$url = getURL();
if ($url) {
  // Validate URL.
  if (validURL($url)) {
    inBedify($url);
  }
}

frontPage();
?>
Ejemplo n.º 2
0
function verifyArticle($articleArray)
{
    $feedback = array();
    if ($articleArray['comment_to'] == "NULL") {
        if (strlen($articleArray['title']) < 2) {
            $feedback[] = getString("title_is_required", "Tittelen mangler.");
        }
    }
    if (strlen($articleArray['body']) < 2) {
        $feedback[] = getString("body_is_required", "Teksten mangler.");
    }
    if (!justTextAndNumbers($articleArray['author'])) {
        $feedback[] = "author_just_text_and_numbers";
    }
    if (!isLoggedIn($articleArray['author_username'])) {
        $feedback[] = "user_does_not_exist";
    }
    if (!mayCreateArticles($articleArray['author_username'])) {
        $feedback[] = "user_cannot_post_article";
    }
    if (!categoryExists($articleArray['category'])) {
        $feedback[] = "category_does_not_exist";
    }
    if (!validDate($articleArray['date_posted'])) {
        $feedback[] = "invalid_date";
    }
    if (!validTime($articleArray['time_posted'])) {
        $feedback[] = "invalid_time";
    }
    //if (!isBoolean($articleArray['is_draft']))
    //$feedback[] = "isdraft_must_be_boolean";
    if (!validURL($articleArray['picture_url'])) {
        $feedback[] = "invalid_url";
    }
    // More than 0 errors, return now
    // First element in array must be -1 to signal error
    if (count($feedback) > 0) {
        array_push($feedback, "-1");
        return array_reverse($feedback);
    }
    $feedback[] = "1";
    return $feedback;
}