vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with plugin (https://vborg.vbsupport.ru/showthread.php?t=183149)

chicote 06-21-2008 02:50 PM

Help with plugin
 
I create 2 fields in a table ABC, the first field is the X and Y is the second, both store data in a form checkbox, 0 if not checked, and 1 case marked.

Now my question is, I want to create a plugin, which store data from the field X and Y of the field on 2 variables for later I make a comparison in postbit and show a message if X = 1, and another case X = 0, the same applies to Y, show some message if Y = 1 and another message if Y = 0;

For this reason I created a plugin with the following code:

Hook Location: Postbit_display_complete

Plugin PHP Code:
PHP Code:

$test $db->query_read("SELECT * FROM"TABLE_PREFIX"ABC"); 
 
$test $db->num_rows($test); 
 
 
$test_x $test['x']; 
 
$test_y  $test['y']; 

Then put the template postbit the following condition:
PHP Code:

<if condition="$test_x =='1'"Testing X </if> 
 <if 
condition="$test_y =='1'"Testing Y </if> 

But nothing worked, someone could help me?

Dismounted 06-21-2008 02:52 PM

You aren't writing in PHP - I suggest you read some material on PHP. :)

chicote 06-21-2008 03:05 PM

It could indicate a tutorial, where I can help me, to correct this plugin?

Thank

Opserty 06-21-2008 03:19 PM

You need to learn the PHP basics, use google and search for "PHP Basics" or "PHP Introduction".

Else try the php.net site. http://www.php.net/manual/en/getting-started.php (You can also view it in different languages)

Dismounted 06-22-2008 06:44 AM

Also, you might want to look up how databases work, or explain your situation more clearly, as I understand it now, all you have is a single row in your table.


All times are GMT. The time now is 06:33 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.01018 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete