summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
commit4f3bce79bfb5851cef9e7bc655c91bb3093cc401 (patch)
tree10a0991fddeb0e075d7fa46e2b40e5dbc64d1e88 /wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
downloadwordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.gz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.xz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.zip
Initial Import
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-content/smarty-plugins/function.getcustomfield.php')
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.getcustomfield.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php b/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
new file mode 100644
index 0000000..9307dcb
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
@@ -0,0 +1,39 @@
+<?php
+
+/* $Id: function.getcustomfield.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+// custom fields hack by Mystis @ http://www.mystis.net/b2customfields.html
+// commentary @ http://tidakada.com/board/viewtopic.php?t=2693
+// Highly modified by Donncha O Caoimh, donncha@linux.ie
+
+function smarty_function_getcustomfield($params, &$smarty)
+{
+ global $tableposts,$id, $site;
+
+ extract( $params );
+
+ $sql = "SELECT field_contents
+ FROM b2customfieldsContents
+ WHERE postID = '".$id."'
+ AND blog = '".$site."'
+ AND field_name = '".$name."'";
+ $result = mysql_query($sql);
+ if( @mysql_num_rows( $result ) )
+ {
+ $row = mysql_fetch_array($result);
+ $output = $row[ 'field_contents' ];
+ $output = convert_bbcode(convert_smilies(stripslashes($output)));
+ if( strstr( $output, ";;;" ) )
+ {
+ $output = split(";;;", $output );
+ }
+ }
+ else
+ {
+ $output = '';
+ }
+
+ $smarty->assign( "customfield", $output );
+}
+
+?>