Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2002, 04:08 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default help with PHP

Hi

I'm trying to modify neo's 'admin avatar size' hack.

I'm changing it so that mods have different sizes to admins.

Could someone please tell me what is wrong this code (I'm gussing it's the wasy I structured it:

PHP Code:
 if ($bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==5) {
    
$customtext "Note: the maximum size of your custom image is $amw in width by $amh in height or $amfs bytes (whichever is smaller).";
  } else {
    
$customtext "Note: the maximum size of your custom image is $mmw in width by $mmh in height or $mmfs bytes (whichever is smaller).";
  } else {
    
$customtext "Note: the maximum size of your custom image is $avatarmaxdimension by $avatarmaxdimension pixels or $avatarmaxsize bytes (whichever is smaller).";
  } 
Thanx
Reply With Quote
  #2  
Old 05-15-2002, 04:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you cannot make a second else clause after one.
you must make it more specific like this:

PHP Code:
if ($bbuserinfo[usergroupid]==7) {
    
$customtext "Note: the maximum size of your custom image is $amw in width by $amh in height or $amfs bytes (whichever is smaller).";
} else {
  if (
$bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==5) {
    
$customtext "Note: the maximum size of your custom image is $mmw in width by $mmh in height or $mmfs bytes (whichever is smaller).";
  } else {
    
$customtext "Note: the maximum size of your custom image is $avatarmaxdimension by $avatarmaxdimension pixels or $avatarmaxsize bytes (whichever is smaller)."
  }

this should work
Reply With Quote
  #3  
Old 05-15-2002, 04:44 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanx xenon, that works

Now i've applied the same format to a piece of code to get this :

PHP Code:
if ($bbuserinfo[usergroupid]==6) {
        if (
$filesize>$amfs) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;
        }
      } else {
    if (
$bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==5) {
         if (
$filesize>$mmfs) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;
    }
      } else {
        if (
$filesize>$avatarmaxsize) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;
        }
      } 
Is it correct?

Thanx again
Reply With Quote
  #4  
Old 05-15-2002, 04:53 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this code is correct, but you have forgotten an } at the end.

i cant see any other error
Reply With Quote
  #5  
Old 05-15-2002, 04:58 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanx that works too but one more error lol

towards the end at about line 1549

[PHP]
}

?>
[/PHP

There is another error.

Thankyou very much for your help
Reply With Quote
  #6  
Old 05-15-2002, 05:02 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what is the errormessage exactly?

errors in the last lines ar often } too much or too less

perhaps you haven't forgotten this } of my last post in your code, but have forgotten it in your post here
Reply With Quote
  #7  
Old 05-15-2002, 07:07 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's not working still

The message i get is:

Parse error: parse error in /home/charmed/public_html/forums/member.php on line 1550
Reply With Quote
  #8  
Old 05-15-2002, 07:49 PM
geniuscrew's Avatar
geniuscrew geniuscrew is offline
 
Join Date: Nov 2001
Location: UK
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually i got it working now

Vielen danken fur deine Hilfe Xenon!


Bye!
Reply With Quote
  #9  
Old 05-15-2002, 08:02 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fine

i'm glad i could help you
Reply With Quote
  #10  
Old 05-15-2002, 11:33 PM
Nutt Nutt is offline
 
Join Date: May 2002
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ($bbuserinfo[usergroupid]==6) {

        if (
$filesize>$amfs) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;
        }

} elseif (
$bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==5) {

        if (
$filesize>$mmfs) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;

      } elseif (
$filesize>$avatarmaxsize) {
          eval(
"standarderror(\"".gettemplate("error_avatartoobig")."\");");
          
// file size too big
          
exit;

      }

You could have used a elseif statement
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 04:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07818 seconds
  • Memory Usage 2,285KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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