Advertisement:

Author Topic: New Field in item-post.php help  (Read 24582 times)

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: New Field in item-post.php help
« Reply #15 on: October 08, 2013, 09:15:07 pm »
Same problem... with 3.1.2
I tried many times and restart of beginning step 1 with clean files core.  :o

mr_ixs

  • Jr. Member
  • **
  • Posts: 53
Re: New Field in item-post.php help
« Reply #16 on: October 10, 2013, 05:58:50 pm »
I'd like to display all personal informations. But I've done as they wrote ad its not workig. Some mistakes. It will be stupid construct another table. Still I'm looking for the errors. Maybe someone done it well. Please share us your solution.

shamim_biplob

  • Full Member
  • ***
  • Posts: 169
Re: New Field in item-post.php help
« Reply #17 on: October 13, 2013, 01:12:16 pm »
how can i validate phone field (server side)?

also if i change in item-post.php

eg.
Code: [Select]
<?php ItemForm::contact_phone_text(); ?>to
Code: [Select]
<input id="contactPhone" type="text" name="contactPhone" placeholder="01xxxxxxxxxxxx" required />
            <span class="form_hint">Proper format "01xxxxxxxxx"</span>

am i doing something wrong ( for security or other)? for other field also(eg. title, description, name, email etc).

if yes, how can i add placeholder, hints, etc in item-post?

TheDeadLives

  • Sr. Member
  • ****
  • Posts: 279
Re: New Field in item-post.php help
« Reply #18 on: October 13, 2013, 08:10:01 pm »
For me it is working all ok. What is your problem? (sorry for late reply)

creat15

  • Full Member
  • ***
  • Posts: 218
Re: New Field in item-post.php help
« Reply #19 on: October 15, 2013, 08:03:14 pm »
For me it is working all ok. What is your problem? (sorry for late reply)

hi, i try your tutorial

but after I tried to post an ad with additional phone numbers, advertising is not made​​, and does not enter into the database

how do I get the tutorial to work properly?

oc_t_item whether to delete the old database and replace the one in the tutorial?

shamim_biplob

  • Full Member
  • ***
  • Posts: 169
Re: New Field in item-post.php help
« Reply #20 on: October 16, 2013, 07:27:35 am »
For me it is working all ok. What is your problem? (sorry for late reply)

hi, i try your tutorial

but after I tried to post an ad with additional phone numbers, advertising is not made​​, and does not enter into the database

how do I get the tutorial to work properly?

oc_t_item whether to delete the old database and replace the one in the tutorial?


add a new row after s_contact_email in table oc_t_item name s_contact_phone manually.......

hope this will solve your problem

TheDeadLives

  • Sr. Member
  • ****
  • Posts: 279
Re: New Field in item-post.php help
« Reply #21 on: October 18, 2013, 12:54:41 am »
For me it is working all ok. What is your problem? (sorry for late reply)

hi, i try your tutorial

but after I tried to post an ad with additional phone numbers, advertising is not made​​, and does not enter into the database

how do I get the tutorial to work properly?

oc_t_item whether to delete the old database and replace the one in the tutorial?


add a new row after s_contact_email in table oc_t_item name s_contact_phone manually.......

hope this will solve your problem
Yes, thats correct. You can add manually or, if you install from scratch, you need to install like this

aks

  • Full Member
  • ***
  • Posts: 179
Re: New Field in item-post.php help
« Reply #22 on: October 18, 2013, 06:25:45 pm »
hi TheDeadLives,
there is a plugin non user mobile..
which has better option.. plugin or your solution...
becoz plugin creates a new table and store mobile in that table (for guest users)

TheDeadLives

  • Sr. Member
  • ****
  • Posts: 279
Re: New Field in item-post.php help
« Reply #23 on: October 19, 2013, 08:29:52 pm »
hi TheDeadLives,
there is a plugin non user mobile..
which has better option.. plugin or your solution...
becoz plugin creates a new table and store mobile in that table (for guest users)

Where that plugin is? This was created because didn´t exist any plugin for this( but the plugin must do the same thing).

mr_ixs

  • Jr. Member
  • **
  • Posts: 53
Re: New Field in item-post.php help
« Reply #24 on: November 04, 2013, 05:17:57 am »
I think about this solution and I try but with mistakes

In database we've got a table item_location
there's a field named 's_address'
I add to this table another field like "s_mobile"

I use insstructions from this post and i searched all fields named address and add new one "mobile"

It looks nic but the problem is that system do not add any data to item_location

I don't know where I made mistakes.

I've just only copying and adding a similar field like 'address'

Maybe I forget any file....

If somebody do this maybe can write a list of files to change
I added data in this files:
item-post.php
item.php
(oc-includes/osclass)
ItemActions.php
Item.form.class.php
hItems.php

Maybe i didn't add somewhere else ?
But I think this solution will be better


aks

  • Full Member
  • ***
  • Posts: 179
Re: New Field in item-post.php help
« Reply #25 on: November 04, 2013, 10:16:38 am »
i also tried that..but did not work.. seems something is missing..

1.i think , similar to email field, mobile no. column should also be added in item table ..
2.in this way, we can lock email,mobile no. entered in a post. and track info. (but it should be fetched from his current profile info.)
3.additionally, there should be an option to show/hide email/mobile.. per posting..
4.email/mobile, once entered in a post should not be editable in item edit page

mr_ixs

  • Jr. Member
  • **
  • Posts: 53
Re: New Field in item-post.php help
« Reply #26 on: November 04, 2013, 04:18:38 pm »
aks:
Also you can delete options in item-post.php and item.php but it will be good.
We got a user panel where we put information like website etc... but it's only for them or admin. We can not use this options to show when you add a new post... Only few information but not all. It's a different way because we should use this option without making a new fields by admin panel.

I try to see more files maybe i forget sth

Maybe someone do that and will be nice to share us

mr_ixs

  • Jr. Member
  • **
  • Posts: 53
Re: New Field in item-post.php help
« Reply #27 on: November 04, 2013, 06:30:00 pm »
I try another time to add a new field and I find it.

Files wich we have to edit:
ItemLocation.php
ItemActions.php
hItems.php
hPremium.php
Item.form.class.php
and files in our themes like:
item-post.php
item.php
also we have to add a field in our database item_location

I think it will be good solution to communicate more user's data with item's data

If u have any better suggestions please write me... But i think it will be more universal and better solution than wrote TheDeadLives.

chavals

  • Newbie
  • *
  • Posts: 1
Re: New Field in item-post.php help
« Reply #28 on: December 30, 2013, 02:29:52 pm »
Hi, I'm doing a test... Osclass 3.2.2 ...

i've created at the database the column "s_contact_phone" (table oc_t_item of course) and in the ItemActions.php add the line  's_contact_phone'       => '999888777', in the $this->manager->insert(array( to test if it works, but it didn't :(, it insert nothing at the database, and in the oc_t_log all is ok, but fk_i_id is 0 (because, the insert before didn't work and it can't returned the ID).

This must work, and i don't know why don't

Code: [Select]
$this->manager->insert(array(
                    'fk_i_user_id'          => $aItem['userId'],
                    'dt_pub_date'           => date('Y-m-d H:i:s'),
                    'fk_i_category_id'      => $aItem['catId'],
                    'i_price'               => $aItem['price'],
                    'fk_c_currency_code'    => $aItem['currency'],
's_contact_name'        => $contactName,
                    's_contact_email'       => $contactEmail,
's_contact_phone'       => '999888777',
's_secret'              => $code,
                    'b_active'              => ($active=='ACTIVE'?1:0),
                    'b_enabled'             => $enabled,
                    'b_show_email'          => $aItem['showEmail'],
                    'b_spam'                => $is_spam,
                    's_ip'                  => $aItem['s_ip']
                ));


any suggestions?

thanks.

PD: i've tried a second test...



After
Code: [Select]
$itemId = $this->manager->dao->insertedId();
without touching the $this->manager->insert(array(

I added
Code: [Select]
$aUpdate = array(
                    's_contact_phone'         => '999888777'
);

$result = $this->manager->update( $aUpdate, array('pk_i_id'  => $itemId,
                                                                  's_secret' => $code ) );

Trying to update the register with the phone number... now the insert works, but the update didn't T_T
« Last Edit: December 30, 2013, 02:42:08 pm by chavals »

CouponsClassifieds

  • Newbie
  • *
  • Posts: 22
  • GarageBargain.com
Re: New Field in item-post.php help
« Reply #29 on: August 22, 2014, 01:07:44 pm »
This modification will be lost on the update of osclass, is there way to add via functions.php or make plugin to show the phone number in item-post.php for unregistered users ?