vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Creating Custom Promotions & validating profile fields (https://vborg.vbsupport.ru/showthread.php?t=292183)

mokujin 12-12-2012 02:53 PM

The user will have to validate (or fill the code you gave) via Edit Profile - Additional Information ?

vibethemes 12-12-2012 03:58 PM

Yes, user will fill the additional fields in "About me" tab and click save (ajax save).....my plugin gets triggered at user_presavedata hook. which means (correct me if I am wrong) that when user enters the value and clicks save, my plugin executes first before saving the value in the database.
My plugin then validates that the entered information is consistent (i.e the API call) and then I change user's usergroup and the value is saved in the profile field.....

mokujin 12-12-2012 04:23 PM

I would rather create a custom page where your users can validate, add a new database table with codes inserted than using the method which you are trying to do.

vibethemes 12-12-2012 05:55 PM

I would not be going for new database as the code is unique for every user and I validate it via a 3rd party call, so I am not aware of the codes the user is having...
Anyways, I believe that I am not doing this right:
PHP Code:

file_get_contents('some API URL'.$this->userfield["field7"].'.json'); 

as soon as I pass the contents of json everything works fine...

mokujin 12-12-2012 06:06 PM

So tell me, what your 'some API URL' is?

vibethemes 12-12-2012 06:10 PM

~~ url removed ~~

just a sample...

--------------- Added [DATE]1355339588[/DATE] at [TIME]1355339588[/TIME] ---------------

I found a js error which appears when someone tries to change the profile field.
http://www.imagetoo.com/images/screentxt.png

--------------- Added [DATE]1355340181[/DATE] at [TIME]1355340181[/TIME] ---------------

I tried with Curl also but no luck....any clues how/why am I getting this js error on profile field save?
Here's my forum link (in case you want to try):
http://forums.vibethemes.com

--------------- Added [DATE]1355341379[/DATE] at [TIME]1355341379[/TIME] ---------------

Update: API call works, validate working, some issue with json handling....working on it..

--------------- Added [DATE]1355370916[/DATE] at [TIME]1355370916[/TIME] ---------------

Finally got it working!!

Cheers!
( v )
http://forums.vibethemes.com


All times are GMT. The time now is 12:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01076 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete