コード例 #1
0
ファイル: ajax.php プロジェクト: hkirsman/tsitaat_com
 function get_quote_for_facebook($q_id)
 {
     global $config_q;
     $a_quote = quote::get_quotes(array("q_id" => $q_id));
     $author_name = str_replace('"', '\\"', $a_quote[0]["author_name"]);
     if (strlen($a_quote[0]["author_born_death"])) {
         $author_born_death = ", " . $a_quote[0]["author_born_death"];
     } else {
         $author_born_death = "";
     }
     $quote = str_replace('"', '\\"', $a_quote[0]["quote"]);
     if (isset($a_quote[0]["author_img"])) {
         $author_img = $config_q["baseurl_static2"] . "/cache/images/" . str_replace(".jpg", "_90px.jpg", $a_quote[0]["author_img"]["nice_name"]);
     } else {
         $author_img = $config_q["baseurl_static2"] . "/img/noauthorimg.jpg";
     }
     $quote_url = $config_q["baseurl"] . "/" . _("quotes") . "/" . _("authors") . "/" . $a_quote[0]["url_friendly_author_name"];
     $quote_url2 = $config_q["baseurl"] . "/" . _("quotes") . "/" . _("authors") . "/" . $a_quote[0]["url_friendly_author_name"] . "/" . $a_quote[0]["quotes_id"];
     $out = "var attachment = {";
     $out .= "'name' : \"" . $author_name . $author_born_death . "\",";
     //$out .= "'caption' : \"".$quote."\",";
     $out .= "'description': \"" . $quote . "\",";
     $out .= "'media': [{'type': 'image', 'src': '" . $author_img . "', 'href': '" . $quote_url . "'}] };";
     $out .= "var action_links = [{'text':'" . _("Go to quotation") . "', 'href':'" . $quote_url2 . "'}];";
     return $out;
 }
コード例 #2
0
ファイル: index.php プロジェクト: hkirsman/tsitaat_com
			"length" => 10,
			"order_by" => "created_time desc",
		));
		$context["quotes"] = $quotes_temp;
		$context["navi"] = $navi->get_page_navi(array(
			"baseurl" => $config_q["baseurl"]."/".$a_path[0],
			"max_items" =>  $quotes_temp[0]["quotes_total_count"],
		));
		
		break;
	case "latest-quotes-%page%":
		$context["h1"] = _("Latest quotes");
		$context["fake_h1"] = _("Latest quotes");
		$quotes_temp = quote::get_quotes(array(
			"start" => (navi::get_current_page()-1)*$config_q["quotes_on_page"],
			"length" => $config_q["quotes_on_page"],
			"order_by" => "created_time desc",
		));
		$context["quotes"] = $quotes_temp;
		$context["navi"] = navi::get_page_navi(array(
			"baseurl" => $config_q["baseurl"]."/".$a_path[0],
			"max_items" =>  $quotes_temp[0]["quotes_total_count"],
		));
		break;
/*
Search
*/
	case "search":
		$smarty_q->assign("title", _("Search"));
		$smarty_q->assign("show_sidecontent", false);
		$smarty_q->assign("content", '