Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Gah! Hacking woes... Details »»
Gah! Hacking woes...
Version: , by Ember Ember is offline
Developer Last Online: Mar 2006 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-29-2003 Last Update: Never Installs: 0
 
No support by the author.

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?

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-29-2003, 01:45 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can members change this value?
Reply With Quote
  #3  
Old 01-29-2003, 02:07 PM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

They will be able to yes.
Reply With Quote
  #4  
Old 01-29-2003, 02:12 PM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit that - they cant edit it directly - it will either be "0" or "1"
Reply With Quote
  #5  
Old 01-29-2003, 05:39 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 01-29-2003, 06:18 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shouldn't that be?

PHP Code:
if ($post['showpet']!=0) {
            eval(
"\$post[petbit] = \"".gettemplate("petbit")."\";");
        } else {
            $
$post[petbit] = "";
        } 
Reply With Quote
  #7  
Old 01-29-2003, 06:56 PM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 01-29-2003, 06:59 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try the code I posted above?
Reply With Quote
  #9  
Old 01-29-2003, 07:05 PM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
        if ($post[showpet]!=0) {
            eval(
"\$post[petbit] = \"".gettemplate("petbit")."\";");
        } else {
            
$post[showpet] = "";
        } 
Thats what I have now - still isnt working... :'(
Reply With Quote
  #10  
Old 01-29-2003, 07:10 PM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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"???
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:58 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.14060 seconds
  • Memory Usage 2,302KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete