boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

b2customfields 2: Better custom post field functionality
Goto page Previous  1, 2, 3, 4, 5, 6
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
billy



Joined: 05 Jul 2003
Posts: 39

PostPosted: Sat Jan 03, 2004 12:38 am    Post subject: Reply with quote

what verison of b2 are you using? my b2edit.php is different from yours
Back to top
View user's profile Send private message
twotwentysix



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sat Jan 03, 2004 12:43 am    Post subject: Reply with quote

no clue! how do I find that out?

Ive been using b2 for almost 2 1/2 years, Ive upraded several times, but I have no idea what version my edit is.
Back to top
View user's profile Send private message
billy



Joined: 05 Jul 2003
Posts: 39

PostPosted: Sat Jan 03, 2004 12:46 am    Post subject: Reply with quote

twotwentysix wrote:
no clue! how do I find that out?

Ive been using b2 for almost 2 1/2 years, Ive upraded several times, but I have no idea what version my edit is.

login to your b2 and then scroll to the bottom, it will say b2then the version numbers for example mine is b2 0.6.2.1
Back to top
View user's profile Send private message
twotwentysix



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sat Jan 03, 2004 12:48 am    Post subject: Reply with quote

it says 06.pre
Back to top
View user's profile Send private message
billy



Joined: 05 Jul 2003
Posts: 39

PostPosted: Sat Jan 03, 2004 12:53 am    Post subject: Reply with quote

i think thats an old old version of b2, and thats why the custom fields isn't working, you should upgrade. there's also a bug in the b2 that makes it vulnerable or something read more here
Back to top
View user's profile Send private message
twotwentysix



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sat Jan 03, 2004 12:55 am    Post subject: Reply with quote

ok, I'm gonna go upgrade, but if my post/edit field is still gone ILL BE BACK!
Back to top
View user's profile Send private message
twotwentysix



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sat Jan 03, 2004 1:23 am    Post subject: Reply with quote

ok, my post/edit is back, but the other hacks that i had for my b2 are gone, but thats ok, I'll install them again and hopefully the custom fields one will work now.
Back to top
View user's profile Send private message
Sammy



Joined: 03 Jan 2004
Posts: 4
Location: Melb, Australia

PostPosted: Sat Jan 03, 2004 7:03 am    Post subject: Reply with quote

This is a good hack! Very Happy Installation for me is looking good until..

When I go to post or edit my posts..

Code:
Warning: Unable to access ./b2er.php in /usr/local/psa/home/vhosts/sekshi.net/httpdocs/glow/b2edit.php on line 136

Fatal error: Failed opening required './b2er.php' (include_path='.:/usr/local/psa/apache/lib/php') in /usr/local/psa/home/vhosts/sekshi.net/httpdocs/glow/b2edit.php on line 136


Does anyone know how to help me?
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
billy



Joined: 05 Jul 2003
Posts: 39

PostPosted: Sat Jan 03, 2004 1:26 pm    Post subject: Reply with quote

good luck twotwentysix, hope everything works for ya.

sammy, can you post your b2edit.php?
Back to top
View user's profile Send private message
Sammy



Joined: 03 Jan 2004
Posts: 4
Location: Melb, Australia

PostPosted: Sat Jan 03, 2004 1:35 pm    Post subject: Reply with quote

Code:
<?php

$title = "Post / Edit";
/* <Edit> */

function add_magic_quotes($array) {
   foreach ($array as $k => $v) {
      if (is_array($v)) {
         $array[$k] = add_magic_quotes($v);
      } else {
         $array[$k] = addslashes($v);
      }
   }
   return $array;
}

if (!get_magic_quotes_gpc()) {
   $HTTP_GET_VARS    = add_magic_quotes($HTTP_GET_VARS);
   $HTTP_POST_VARS   = add_magic_quotes($HTTP_POST_VARS);
   $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS);
}

$b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url');
for ($i=0; $i<count($b2varstoreset); $i += 1) {
   $b2var = $b2varstoreset[$i];
   if (!isset($$b2var)) {
      if (empty($HTTP_POST_VARS["$b2var"])) {
         if (empty($HTTP_GET_VARS["$b2var"])) {
            $$b2var = '';
         } else {
            $$b2var = $HTTP_GET_VARS["$b2var"];
         }
      } else {
         $$b2var = $HTTP_POST_VARS["$b2var"];
      }
   }
}

switch($action) {
   
case 'post':

   $standalone = 1;
   require_once('./b2er.php');

   $post_autobr = intval($HTTP_POST_VARS["post_autobr"]);
   $post_pingback = intval($HTTP_POST_VARS["post_pingback"]);
   $content = balanceTags($HTTP_POST_VARS["content"]);
   $content = format_to_post($content);
   $post_title = addslashes($HTTP_POST_VARS["post_title"]);
   $post_category = intval($HTTP_POST_VARS["post_category"]);

   if ($user_level == 0)
   die ("Cheatin' uh ?");

   if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
      $aa = $HTTP_POST_VARS["aa"];
      $mm = $HTTP_POST_VARS["mm"];
      $jj = $HTTP_POST_VARS["jj"];
      $hh = $HTTP_POST_VARS["hh"];
      $mn = $HTTP_POST_VARS["mn"];
      $ss = $HTTP_POST_VARS["ss"];
      $jj = ($jj > 31) ? 31 : $jj;
      $hh = ($hh > 23) ? $hh - 24 : $hh;
      $mn = ($mn > 59) ? $mn - 60 : $mn;
      $ss = ($ss > 59) ? $ss - 60 : $ss;
      $now = "$aa-$mm-$jj $hh:$mn:$ss";
   } else {
      $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600)));
   }

   /* Edited for b2customfields */
$sql1 = "SELECT * FROM b2customfields";
$result1 = mysql_query($sql1);
$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category";
$queryadd = "";
while($row1 = mysql_fetch_array($result1)){
   $query .= ",".$row1['field_name'];
   if($row1['field_type']=="checkbox"&&empty($_POST[$row1['field_name']])){
      $queryadd .= ",'0'";
   }else{
      $queryadd .= ",'".$_POST[$row1['field_name']]."'";
   }
}
$query .= ") VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."'".$queryadd.")";
/* End edited for b2customfields */
   $result = mysql_query($query) or mysql_oops($query);

   $post_ID = mysql_insert_id();

   if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
      sleep($sleep_after_edit);
   }

   rss_update($blog_ID);
   pingWeblogs($blog_ID);
   pingCafelog($cafelogID, $post_title, $post_ID);
   pingBlogs($blog_ID);
   if ($post_pingback) {
      pingback($content, $post_ID);
   }

   if (!empty($HTTP_POST_VARS['trackback_url'])) {
      $excerpt = (strlen(strip_tags($content)) > 255) ? substr(strip_tags($content), 0, 252).'...' : strip_tags($content);
      $excerpt = stripslashes($excerpt);
      $trackback_urls = explode(',', $HTTP_POST_VARS['trackback_url']);
      foreach($trackback_urls as $tb_url) {
         $tb_url = trim($tb_url);
         trackback($tb_url, stripslashes($post_title), $excerpt, $post_ID);
      }
   }

   if (!empty($HTTP_POST_VARS["mode"])) {
      switch($HTTP_POST_VARS["mode"]) {
         case "bookmarklet":
            $location="b2bookmarklet.php?a=b";
            break;
         case "sidebar":
            $location="b2sidebar.php?a=b";
            break;
         default:
            $location="b2edit.php";
            break;
      }
   } else {
      $location="b2edit.php";
   }
   er("Location: $location");
   exit();

break;

case "edit":

   $standalone=0;
   require_once ("./b2er.php");
   $post = $HTTP_GET_VARS["post"];
   if ($user_level > 0) {
      $postdata=get_postdata($post) or die("Oops, no post with this ID. <a href=\"b2edit.php\">Go back</a> !");
      $authordata = get_userdata($postdata["Author_ID"]);
   if ($user_level < $authordata[13])
   die ("You don't have the right to edit <b>".$authordata[1]."</b>'s posts.");

   $content = $postdata["Content"];
   $content = format_to_edit($content);
   $edited_post_title = format_to_edit($postdata["Title"]);

   echo $blankline;
   include($b2inc."/b2edit.form.php");

   } else {
   ?>

   Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />You can also <a href="mailto:<?php echo $admin_email ?>?subject=b2-promotion">e-mail the admin</a> to ask for a promotion.<br />When you're promoted, just reload this page and you'll be able to blog. :)

   <?php
   }

break;

case "editpost":

   $standalone = 1;
   require_once("./b2header.php");
   
   if ($user_level == 0)
   die ("Cheatin' uh ?");

   if (!isset($blog_ID)) {
      $blog_ID = 1;
   }
   $post_ID = $HTTP_POST_VARS["post_ID"];
   $post_category = intval($HTTP_POST_VARS["post_category"]);
   $post_autobr = intval($HTTP_POST_VARS["post_autobr"]);
   $content = balanceTags($HTTP_POST_VARS["content"]);
   $content = format_to_post($content);
   $post_title = addslashes($HTTP_POST_VARS["post_title"]);

   if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
      $aa = $HTTP_POST_VARS["aa"];
      $mm = $HTTP_POST_VARS["mm"];
      $jj = $HTTP_POST_VARS["jj"];
      $hh = $HTTP_POST_VARS["hh"];
      $mn = $HTTP_POST_VARS["mn"];
      $ss = $HTTP_POST_VARS["ss"];
      $jj = ($jj > 31) ? 31 : $jj;
      $hh = ($hh > 23) ? $hh - 24 : $hh;
      $mn = ($mn > 59) ? $mn - 60 : $mn;
      $ss = ($ss > 59) ? $ss - 60 : $ss;
      $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\"";
   } else {
      $datemodif = "";
   }

   /* Edited for b2customfields */
$sql1 = "SELECT * FROM b2customfields";
$result1 = mysql_query($sql1);
$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category";
$queryadd = "";
while($row1 = mysql_fetch_array($result1)){
   $query .= ",".$row1['field_name'];
   if($row1['field_type']=="checkbox"&&empty($_POST[$row1['field_name']])){
      $queryadd .= ",'0'";
   }else{
      $queryadd .= ",'".$_POST[$row1['field_name']]."'";
   }
}
$query .= ") VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."'".$queryadd.")";
/* End edited for b2customfields */
$query = "UPDATE $tableposts SET post_content=\"$content\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif;
$sql = "SELECT * FROM b2customfields";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
   if($row['field_type']=="checkbox"&&empty($_POST[$row['field_name']])){
      $query .= ", ".$row['field_name']."=\"0\"";
   }else{
      $query .= ", ".$row['field_name']."=\"".$_POST[$row['field_name']]."\"";
   }
}
$query .= " WHERE ID=$post_ID";
/* End edited for b2customfields */
   $result = mysql_query($query) or mysql_oops($query);

   if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
      sleep($sleep_after_edit);
   }

   rss_update($blog_ID);
//   pingWeblogs($blog_ID);

   $location = "Location: b2edit.php";
   header ($location);

break;

case "delete":

   $standalone = 1;
   require_once("./b2header.php");

   if ($user_level == 0)
   die ("Cheatin' uh ?");

   $post = $HTTP_GET_VARS['post'];
   $postdata=get_postdata($post) or die("Oops, no post with this ID. <a href=\"b2edit.php\">Go back</a> !");
   $authordata = get_userdata($postdata["Author_ID"]);

   if ($user_level < $authordata[13])
   die ("You don't have the right to delete <b>".$authordata[1]."</b>'s posts.");

   $query = "DELETE FROM $tableposts WHERE ID=$post";
   $result = mysql_query($query) or die("Oops, no post with this ID. <a href=\"b2edit.php\">Go back</a> !");
   if (!$result)
   die("Error in deleting... contact the <a href=\"mailto:$admin_email\">webmaster</a>...");

   $query = "DELETE FROM $tablecomments WHERE comment_post_ID=$post";
   $result = mysql_query($query) or die("Oops, no comment associated to that post. <a href=\"b2edit.php\">Go back</a> !");

   if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
      sleep($sleep_after_edit);
   }

   rss_update($blog_ID);
//   pingWeblogs($blog_ID);

   header ("Location: b2edit.php");

break;

case "editcomment":

   $standalone=0;
   require_once ("./b2header.php");

   get_currentuserinfo();

   if ($user_level == 0) {
      die ("Cheatin' uh ?");
   }

   $comment = $HTTP_GET_VARS['comment'];
   $commentdata = get_commentdata($comment,1) or die("Oops, no comment with this ID. <a href=\"javascript:history.go(-1)\">Go back</a> !");
   $content = $commentdata["comment_content"];
   $content = format_to_edit($content);
   
   echo $blankline;
   include($b2inc."/b2edit.form.php");

break;

case "deletecomment":

   $standalone = 1;
   require_once("./b2header.php");

   if ($user_level == 0)
      die ("Cheatin' uh ?");

   $comment = $HTTP_GET_VARS['comment'];
   $p = $HTTP_GET_VARS['p'];
   $commentdata=get_commentdata($comment) or die("Oops, no comment with this ID. <a href=\"b2edit.php\">Go back</a> !");

   $query = "DELETE FROM $tablecomments WHERE comment_ID=$comment";
   $result = mysql_query($query) or die("Oops, no comment with this ID. <a href=\"b2edit.php\">Go back</a> !");

   header ("Location: b2edit.php?p=$p&c=1#comments"); //?a=dc");

break;

case "editedcomment":

   $standalone = 1;
   require_once("./b2header.php");

   if ($user_level == 0)
      die ("Cheatin' uh ?");

   $comment_ID = $HTTP_POST_VARS['comment_ID'];
   $comment_post_ID = $HTTP_POST_VARS['comment_post_ID'];
   $newcomment_author = $HTTP_POST_VARS['newcomment_author'];
   $newcomment_author_email = $HTTP_POST_VARS['newcomment_author_email'];
   $newcomment_author_url = $HTTP_POST_VARS['newcomment_author_url'];
   $newcomment_author = addslashes($newcomment_author);
   $newcomment_author_email = addslashes($newcomment_author_email);
   $newcomment_author_url = addslashes($newcomment_author_url);
   $post_autobr = $HTTP_POST_VARS["post_autobr"];

   if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
      $aa = $HTTP_POST_VARS["aa"];
      $mm = $HTTP_POST_VARS["mm"];
      $jj = $HTTP_POST_VARS["jj"];
      $hh = $HTTP_POST_VARS["hh"];
      $mn = $HTTP_POST_VARS["mn"];
      $ss = $HTTP_POST_VARS["ss"];
      $jj = ($jj > 31) ? 31 : $jj;
      $hh = ($hh > 23) ? $hh - 24 : $hh;
      $mn = ($mn > 59) ? $mn - 60 : $mn;
      $ss = ($ss > 59) ? $ss - 60 : $ss;
      $datemodif = ", comment_date=\"$aa-$mm-$jj $hh:$mn:$ss\"";
   } else {
      $datemodif = "";
   }
   $content = balanceTags($content);
   $content = format_to_post($content);

   $query = "UPDATE $tablecomments SET comment_content=\"$content\", comment_author=\"$newcomment_author\", comment_author_email=\"$newcomment_author_email\", comment_author_url=\"$newcomment_author_url\"".$datemodif." WHERE comment_ID=$comment_ID";
   $result = mysql_query($query) or mysql_oops($query);

   header ("Location: b2edit.php?p=$comment_post_ID&c=1#comments"); //?a=ec");

break;

default:

   $standalone=0;
   require_once ("./b2header.php");
   
   if ($user_level > 0) {
      if ((!$withcomments) && (!$c)) {

         $action="post";
         include($b2inc."/b2edit.form.php");
         echo "<br /><br />";

      }   

   } else {

      echo $tabletop; ?>
      Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />You can also <a href="mailto:<?php echo $admin_email ?>?subject=b2-promotion">e-mail the admin</a> to ask for a promotion.<br />When you're promoted, just reload this page and you'll be able to blog. :)
      <?php
      echo $tablebottom;
      echo "<br /><br />";

   }

   include($b2inc."/b2edit.showposts.php");

}


/* </Edit> */
include($b2inc."/b2footer.php") ?>
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiaLaToThSla



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sat Jan 03, 2004 7:11 pm    Post subject: Reply with quote

Ok, sorry to throw up another one, I think I've got it all working apart from B2 being able to show it on the page. Where the "listening to" bit should appear, I get this error:

Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/chris/public_html/eriatarka/b2-include/b2template.functions.php on line 1226


Line 1226 reads:

Code:
while ($row = mysql_fetch_array($result)){


Anyone got any ideas?
Back to top
View user's profile Send private message
billy



Joined: 05 Jul 2003
Posts: 39

PostPosted: Sun Jan 04, 2004 3:57 am    Post subject: Reply with quote

do you have any other hack installed?
Back to top
View user's profile Send private message
Sammy



Joined: 03 Jan 2004
Posts: 4
Location: Melb, Australia

PostPosted: Sun Jan 04, 2004 7:26 am    Post subject: Reply with quote

don't worry, thanks billy! it's working now.. Smile

i'm using this code in my templates:

Code:
<?
$mood = getcustomfield('mood');
if(!empty($mood)){
     echo "Mood: ".$mood;
}
?>


but it doesnt work for me.. the "mood:" part doesn't come up..
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
LiaLaToThSla



Joined: 02 Jan 2004
Posts: 8

PostPosted: Sun Jan 04, 2004 1:27 pm    Post subject: Reply with quote

No, this is the only hack i'm attempting to use.
Back to top
View user's profile Send private message
BluntedbyNature



Joined: 26 Mar 2003
Posts: 5
Location: New York

PostPosted: Fri Jan 09, 2004 3:24 am    Post subject: Reply with quote

groar! alright i read all 6 pages, and none of the solutions are working for me... alright here is my problem, i installed the hack, i made my stuff... but now my post is gone, and only one of my custom feilds are showin up, but and i get this error.
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site90/fst/var/www/html/b2-include/b2edit.form.php on line 118

here is my code for my b2edit.form.php
Code:
<?php
echo $tabletop;

switch($action) {
   case "post":
      $submitbutton_text = "Blog this !";
      $toprow_title = "New Post";
      $form_action = "post";
      $form_extra = "";
      if ($use_pingback) {
         $form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack the URLs in this post</label><br />';
      } else {
         $form_pingback = '';
      }
      if ($use_trackback) {
         $form_trackback = '<br /><br /><label for="trackback"><b>TrackBack</b> an URL:</label><br /><input type="text" name="trackback_url" style="width: 415px" id="trackback" />';
      } else {
         $form_trackback = '';
      }
      $colspan = 3;
      break;
   case "edit":
      $submitbutton_text ="Edit this !";
      $toprow_title = "Editing Post #".$postdata["ID"];
      $form_action = "editpost";
      $form_extra = "\" />\n<input type=\"hidden\" name=\"post_ID\" value=\"$post";
      $colspan = 2;
      $form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
      $form_trackback = '';
      break;
   case "editcomment":
      $submitbutton_text ="Edit this !";
      $toprow_title = "Editing Comment #".$commentdata["comment_ID"];
      $form_action = "editedcomment";
      $form_extra = "\" />\n<input type=\"hidden\" name=\"comment_ID\" value=\"$comment\" />\n<input type=\"hidden\" name=\"comment_post_ID\" value=\"".$commentdata["comment_post_ID"];
      $colspan = 3;
      $form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
      $form_trackback = '';
      break;
}

?>

<form name="post" action="b2edit.php" method="POST">
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="action" value="<?php echo $form_action.$form_extra ?>" />

<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
   <td<?php

if ($action != "editcomment") {

// this is for everything but comment editing
   ?>>
   <table height="60" align="left" cellpadding="0" cellspacing="0">
      <td height="60" width="190">
      <label for="title"><b>Title :</b></label><br />
      <input type="text" name="post_title" size="20" tabindex="1" style="width: 170px;" value="<?php echo $edited_post_title; ?>" id="title" />
      </td>
      <td>
      <label for="category"><b>Category :</b></label><br /><?php dropdown_categories(); ?>
      </td>
   </table>
   <?php

} else {
   
// this is for comment editing
   ?> colspan="2"> </td>
</tr>

<tr>
   <td>
   <label for="name"><b>Name :</b></label><br />
   <input type="text" name="newcomment_author" size="20" value="<?php echo format_to_edit($commentdata["comment_author"]) ?>" tabindex="1" id="name" /></td>
   <td>
   <label for="email"><b>E-mail :</b></label><br />
   <input type="text" name="newcomment_author_email" size="20" value="<?php echo format_to_edit($commentdata["comment_author_email"]) ?>" tabindex="2" id="email" /></td>
   <td>
   <label for="URL"><b>URL :</b></label><br />
   <input type="text" name="newcomment_author_url" size="20" value="<?php echo format_to_edit($commentdata["comment_author_url"]) ?>" tabindex="3" id="URL" />
   <?php
   
}

   ?>
   </td>
</tr>
<tr>
<td colspan="<?php echo $colspan; ?>">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<td valign="bottom">
<?php
if ($action != 'editcomment') {
   echo '<label for="content"><b>Post :</b></label>';
} else {
   echo '<br /><label for="content"><b>Comment :</b></label>';
}
?>
</td>
<td valign="bottom" align="right">
<?php if ($use_quicktags) include($b2inc.'/b2quicktags.php'); ?>
</td>
</table>

<?
/* Edited for b2customfields */
$sql = "SELECT * FROM b2customfields";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
   $subsql = "SELECT ".$row['field_name']." FROM $tableposts";
   if($_GET['action'] == 'edit'){
         $subsql .=  " where ID = ".$postdata["ID"];
   }
   $subsql .= " LIMIT 1";
   $subresult = mysql_query($subsql);
   while ($subrow = mysql_fetch_array($subresult)){
      switch($row['field_type']){
         default :
            if($_GET['action'] == 'edit'){
               echo "<b>".$row["field_name"]." :</b><br /><input size=\"20\" style=\"width: 170px;\" name=\"".$row["field_name"]."\" value=\"".$subrow[0]."\"><br />";
            }else{
               echo "<b>".$row["field_name"]." :</b><br /><input size=\"20\" style=\"width: 170px;\" name=\"".$row["field_name"]."\"><br />";
            }
         break;
         case "textarea" :
            if($_GET['action'] == 'edit'){
               echo "<b>".$row["field_name"]." :</b><br /><textarea rows=\"9\" cols=\"40\" style=\"width:100%\" name=\"".$row["field_name"]."\" wrap=\"virtual\">".$subrow[0]."</textarea><br />";
            }else{
               echo "<b>".$row["field_name"]." :</b><br /><textarea rows=\"9\" cols=\"40\" style=\"width:100%\" name=\"".$row["field_name"]."\" wrap=\"virtual\"></textarea><br />";
            }
         break;
         case "checkbox" :
            if($_GET['action'] == 'edit'){
               switch($subrow[0]){
                  case "1" :
                     $checked = " checked";
                  break;
                  default :
                     $checked = "";
                  break;
               }
               echo "<input type=\"checkbox\" class=\"checkbox\" name=".$row["field_name"]." value=\"1\"".$checked." /> ".$row["field_name"]."<br />";
            }else{
               echo "<input type=\"checkbox\" class=\"checkbox\" name=".$row["field_name"]." value=\"1\" /> ".$row["field_name"]."<br />";
            }
         break;
         case "dropdown" :
            if($_GET['action'] == 'edit'){
               echo "<b>".$row["field_name"]." :</b><br /><select style=\"width:170px;\" name=\"".$row["field_name"]."\">";
               $options = explode(';;',$row["field_options"]);
               foreach ($options as $option){
                  switch($subrow[0]){
                     case $option :
                        $selected = " selected";
                     break;
                     default :
                        $selected = "";
                     break;
                  }
                  echo "<option value=\"".$option."\"".$selected.">".$option."</option>";                     
               }
               echo "</select><br />";
            }else{
               echo "<b>".$row["field_name"]." :</b><br /><select style=\"width:170px;\" name=\"".$row["field_name"]."\">";
               $options = explode(';;',$row["field_options"]);
               foreach ($options as $option){
                  echo "<option value=\"".$option."\">".$option."</option>";
               }
               echo "</select><br />";
            }
         break;
      }
   }
}
/* Edited for b2customfields */
?>

<input type="checkbox" class="checkbox" name="post_autobr" value="1" <?php
if ($autobr)
echo " checked" ?> tabindex="7" id="autobr" /><label for="autobr"> Auto-BR (converts line-breaks into <br /> tags)</label><br />

<? $form_pingback ?>

<?php if ($use_preview) { ?>
<input type="button" value="preview" onclick="preview(this.form);" class="search" tabindex="8" />
<?php } ?>

<input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" class="search" style="font-weight: bold;" tabindex="5" />

<?php if ($use_spellchecker) { ?>
<!--<input type = "button" value = "Spell Check" onclick="var f=document.forms[0]; doSpell( 'en', f.post_content, '<?php echo $spellchecker_url ?>/sproxy.cgi', true);" class="search" tabindex="5" />-->
<input type="button" value="Spellcheck" onclick="DoSpell
('post','content','');" class="search" tabindex="9"/>
<?php } ?>

<?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
<input type="button" value="upload a file/image" onclick="launchupload();" class="search"  tabindex="10" />
<?php }

echo $form_trackback;

// if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
#if (($user_level > 4) && ($action != "post"))
if ($user_level > 4) {
   touch_time(($action=="edit"));
}
?>
<script language="JavaScript">
<!--
//   document.blog.post_content.focus();
//-->
</script>
</td>
</tr>
</table>
<?php echo $tablebottom ?>
</form>


also, incase you couldnt figure out what i ment up there here is a screen shot... http://www.bluntedbynature.com/b2error.jpg

one and my version is b2 0.6.2.1
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6
Page 6 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group