vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Gah! Hacking woes... (https://vborg.vbsupport.ru/showthread.php?t=48284)

Ember 01-29-2003 01:39 PM

Gah! Hacking woes...
 
Ok, I have myself stuck again, here is what I have:

In functions.php

PHP Code:

        if ($post['showpet']!="0") {
            eval(
"\$post[petbit] = \"".gettemplate("petbit")."\";");
        } else {
            
$post[showpet] = " ";
        } 

Along with all the rest of my pet hack stuff - I've added ^^^ that stuff above it.

Then I have added a new template called petbit and posted what was previously in the postbit tempate into it.

Then I have added $post[showpet] into the postbit.

I also have a new field in the user CP called showpet and in that I have "0"....

What should happen is it should see that showpet is set to 0 and then show the petbit... but it doesnt, it shows nothing.

Then if I change whats in the showpet field to 1 - it shows the one (when its set to 0 it shows nothing)

Any ideas what the problem is? :D:D

geniuscrew 01-29-2003 01:45 PM

Can members change this value?

Ember 01-29-2003 02:07 PM

They will be able to yes.

Ember 01-29-2003 02:12 PM

Edit that - they cant edit it directly - it will either be "0" or "1"

geniuscrew 01-29-2003 05:39 PM

Like I said, see if

changing

PHP Code:

if ($post['showpet']!="0") { 

to


PHP Code:

if ($post['showpet']!=="0") { 

does anything.

Knowing me, it probably won't lol

Boofo 01-29-2003 06:18 PM

Shouldn't that be?

PHP Code:

if ($post['showpet']!=0) {
            eval(
"\$post[petbit] = \"".gettemplate("petbit")."\";");
        } else {
            $
$post[petbit] = "";
        } 


Ember 01-29-2003 06:56 PM

ok, here's an update on the problem...

I have it storing a 0 or a 1 into the database now, which is good..

then i use $post[petbit]

it should show the template called petbit - thats goin on this bit of code:

PHP Code:

        if ($post['showpet']!=="0") {
            eval(
"\$post['petbit'] = \"".gettemplate("petbit")."\";");
        } else {
            
$post[showpet] = "";
        } 

However, it either shows nothing when the user has it on "yes" (0) or a 1 when they have it on "no" (1)

Any ideas?

Boofo 01-29-2003 06:59 PM

Did you try the code I posted above?

Ember 01-29-2003 07:05 PM

PHP Code:

        if ($post[showpet]!=0) {
            eval(
"\$post[petbit] = \"".gettemplate("petbit")."\";");
        } else {
            
$post[showpet] = "";
        } 

Thats what I have now - still isnt working... :'(

Ember 01-29-2003 07:10 PM

Quote:

Originally posted by Boofo
Did you try the code I posted above?
After removing the extra $ - I now have it displaying a "0" if they have selected "yes" and a "1" if they have selected "no".... so how can I get it to include the petbit template if its a "0" and nothing if its a "1"???


All times are GMT. The time now is 11:44 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.01083 seconds
  • Memory Usage 1,745KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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