Jump to content

(SD33) Posts Fields


Spanner

Recommended Posts

%7Boption%7D



File Name: (SD33) Posts Fields

File Submitter: Spanner

File Submitted: 20 Jun 2012

File Category: User and Social Engagement

Supported Versions: IP.Board 3.2.x, IP.Board 3.3.x, IP.Board 3.4.x



Author: Dawid Baruch (IPSBeyond.pl)

Opis: Aplikacja pozwala na dodawanie dodatkowych pól podczas pisania tematów i/lub dodawania obrazków w galerii.

Description: Application allows to add additional fields when users add new topics or images to gallery.



here to download this file

Link to comment
Share on other sites

  • 2 months later...

Got this error when i try to add a new field in ACP:


Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'maxvalue FROM sd_pf_fields' at line 1

IP Address: 99.65.211.107 - /congpho/admin/index.php?adsess=4ca8a5c27fb37dec7be74aa6966dea73&app=postsfields&module=managefields&section=managefields&do=doadd

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

mySQL query error: SELECT max(field_position) as maxvalue FROM sd_pf_fields

.--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.

| File																	   | Function																	  | Line No.		  |

|----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------|

| admin/applications_addon/other/postsfields/modules_admin/managefields/managefields.php| [postsfields].getMaxFieldPosition											 | 343			   |

'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'

| admin/applications_addon/other/postsfields/modules_admin/managefields/managefields.php| [admin_postsfields_managefields_managefields].saveForm					    | 113			   |

'----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'

| admin/sources/base/ipsController.php									   | [admin_postsfields_managefields_managefields].doExecute					   | 306			   |



Can you tell me how to fix it

Link to comment
Share on other sites

Hi,
open: /admin/applications_addon/other/postsfields/sources/classPostsFields.php
Find:

    /**

     * Return max position

     */

    public function getMaxFieldPosition()

    {

   	 $fieldInfo = $this->DB->buildAndFetch( array(

							    'select' => 'max(field_position) as maxvalue',

							    'from'   => 'sd_pf_fields',

					    )   );


	    return isset( $fieldInfo[ 'maxvalue' ] ) ? $fieldInfo[ 'maxvalue' ] + 1 : 1;

    }

Replace to:

    /**

     * Return max position

     */

    public function getMaxFieldPosition()

    {

   	 $fieldInfo = $this->DB->buildAndFetch( array(

							    'select' => 'max(field_position) as "maxvalue"',

							    'from'   => 'sd_pf_fields',

					    )   );


	    return isset( $fieldInfo[ 'maxvalue' ] ) ? $fieldInfo[ 'maxvalue' ] + 1 : 1;

    }

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

I'm also getting this SQL error when adding a field in ACP:

Latest SQL Error Today (Today, 07:31 PM)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Date: Thu, 21 Feb 2013 19:31:14 +0000
 Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'maxvalue FROM sd_pf_fields' at line 1
 IP Address: 85.86.209.242 - /admin/index.php?adsess=c6b60b4be27dc12e8de0b80a0c67bb56&app=postsfields&module=managefields&section=managefields&do=doadd
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 mySQL query error: SELECT max(field_position) as maxvalue FROM sd_pf_fields
 .--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
 | File                                                                       | Function                                                                      | Line No.          |
 |----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------|
 | admin/applications_addon/other/postsfields/modules_admin/managefields/managefields.php| [postsfields].getMaxFieldPosition                                             | 343               |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 | admin/applications_addon/other/postsfields/modules_admin/managefields/managefields.php| [admin_postsfields_managefields_managefields].saveForm                        | 113               |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 | admin/sources/base/ipsController.php                                       | [admin_postsfields_managefields_managefields].doExecute                       | 306               |
 '----------------------------------------------------------------------------+----------------------------------------------------------

The board version is latest 3.4.2 and Mod version is the current (uploaded december 2012).

What should I do?

Link to comment
Share on other sites

Read topic

Hi,
open: /admin/applications_addon/other/postsfields/sources/classPostsFields.php
Find:

/**
     * Return max position
     */
    public function getMaxFieldPosition()
    {
   	 $fieldInfo = $this->DB->buildAndFetch( array(
							    'select' => 'max(field_position) as maxvalue',
							    'from'   => 'sd_pf_fields',
					    )   );
					    
	    return isset( $fieldInfo[ 'maxvalue' ] ) ? $fieldInfo[ 'maxvalue' ] + 1 : 1;
    }


Replace to:



/**
     * Return max position
     */
    public function getMaxFieldPosition()
    {
   	 $fieldInfo = $this->DB->buildAndFetch( array(
							    'select' => 'max(field_position) as "maxvalue"',
							    'from'   => 'sd_pf_fields',
					    )   );
					    
	    return isset( $fieldInfo[ 'maxvalue' ] ) ? $fieldInfo[ 'maxvalue' ] + 1 : 1;
    }
Link to comment
Share on other sites

  • 2 years later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...