vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   uCash & uShop (https://vborg.vbsupport.ru/forumdisplay.php?f=100)
-   -   Custom Avatar Action (https://vborg.vbsupport.ru/showthread.php?t=78196)

Link14716 03-16-2005 12:32 AM

Custom Avatar Action
 
1 Attachment(s)
Here is the custom avatar action from 1.0.0 made to work on 0.95. It should work correctly, if you already installed it from the other thread, then upload this new version of action.customavatar.php.

Make a new template: uttstore_inputs_file:
HTML Code:

<input type="hidden" name="MAX_FILE_SIZE" value="$field[maxsize]" /><fieldset style="text-align: right;"><legend>$field[topphrase]</legend>
<div style="float: left;">$field[mainphrase]</div> <input type="file" name="$name" value="$value" size="$field[size]"></fieldset>

In your uttstore_standard_inputs template:

Find:
HTML Code:

<form action="ushop.php" method="post">
Replace with:
HTML Code:

<form action="ushop.php" method="post" enctype="multipart/form-data">
In includes/functions_uttstore.php:
Find:
PHP Code:

function uttstore_globalize_fields($fields) {
    
// Because damnit, I am about to gouge my eyes out.
    
$_FIELD $_POST['_FIELDS'];
    foreach (
$fields as $name => $field) {
        if (
$field['datatype'] == 'INT') {
            
// integer value - run intval() on data
            
$_FIELDS["$name"] = intval($_FIELD[$name]);
        } elseif (
$field['datatype'] == 'POINTS') {
            
$_FIELDS["$name"] = uttpoints_number_format($_FIELD[$name]);
        } elseif (
$field['datatype'] == 'STR_NOHTML') {
            
// html-safe string - trim and htmlspecialchars data
            
$_FIELDS["$name"] = htmlspecialchars_uni(trim($_FIELD[$name]));
        } elseif (
$field['datatype'] == 'STR') {
            
// string - trim data
            
$_FIELDS["$name"] = trim($_FIELD[$name]);
        } else {
            
$_FIELDS["$name"] = $_FIELD[$name];
        }
    }
    return 
$_FIELDS;


Replace with:
PHP Code:

function uttstore_globalize_fields($fields) {
    
// Now with the added bonus of working!
    
$_FIELD $_POST['_FIELDS'];
    
// Some backported code from 1.0.x is in here.
    
foreach ($fields as $name => $field) {
        if (
$field['bypassfields'] != true) {
            
$data $_FIELD[$name];
        } else {
            
$data $_POST[$name];
        }
        if (
$field['datatype'] == 'INT') {
            
// integer value - run intval() on data
            
$_FIELDS["$name"] = intval($data);
        } elseif (
$field['datatype'] == 'POINTS') {
            
$_FIELDS["$name"] = uttpoints_number_format($data);
        } elseif (
$field['datatype'] == 'STR_NOHTML') {
            
// html-safe string - trim and htmlspecialchars data
            
$_FIELDS["$name"] = htmlspecialchars_uni(trim($data));
        } elseif (
$field['datatype'] == 'STR') {
            
// string - trim data
            
$_FIELDS["$name"] = trim($data);
        } else {
            
$_FIELDS["$name"] = $data;
        }
    }
    return 
$_FIELDS;


Finish this by making a new action for uttstore/action.customavatar.php (and obviously upload it to the right location).

stevey 03-21-2005 05:59 PM

hi i have try to do this but i get this error when you click on the confirm button:

Fatal error: Call to undefined function: uttstore_construct_input_fields() in /home/co4mp2u/public_html/uttstore/action.customavatar.php on line 47

Link14716 03-21-2005 06:58 PM

Looks like I forgot to change the function name so it will work with 0.95. It is typo'd in 0.95. Try the file now.

stevey 03-22-2005 12:19 AM

works now :) thanks, i just have to figure out how to stop people uploading avatars through there control panel now, im guessing i just turn the option off in the permissions

Link14716 03-22-2005 12:36 AM

Quote:

Originally Posted by stevey
works now :) thanks, i just have to figure out how to stop people uploading avatars through there control panel now, im guessing i just turn the option off in the permissions

Turn the option off in the usergroup permissions, yes.

stevey 03-22-2005 07:38 AM

cool thanks :)

Wifey 04-01-2005 08:09 PM

1 Attachment(s)
Mine is not working. I reuploaded the file, everything. I have everything done correctly, any ideas? I attached what isn't working - there isn't an input field for a custom avatar period. No clue why.

Wifey 04-03-2005 08:38 PM

I get this on another add-on I've tried installing - the gift one - what am I doing wrong? I've got everything set up perfectly in my forum...I installed the store and every other hack y'all've made (yes, because I'm cool I can use a contraction within a contraction, thereby just proving what a Texan I am, Oye)

Any help would be GREAT!

Link14716 04-05-2005 03:07 PM

Quote:

Originally Posted by ashkarita
Mine is not working. I reuploaded the file, everything. I have everything done correctly, any ideas? I attached what isn't working - there isn't an input field for a custom avatar period. No clue why.

Well, I could see the upload part not showing if you didn't make the template as mentioned in the first post, however, the URL one still would show up. Try reverting the uttstore_standard_confirmation and uttstore_standard_inputs templates.

carolmyt 04-09-2005 08:50 PM

So, this will override the fact that the usergroup won't have permission to upload there own avatar?

Link14716 04-09-2005 09:10 PM

Yes. Otherwise it would be pointless, wouldn't it? :p

carolmyt 04-10-2005 05:36 PM

Exactly. Ok, awesome, I can't wait to install this. My members are seriously getting violent over the previously suggested prospect of buying custom avs; if I don't get this going soon, riots will probably start breaking out.

LauraFL 04-12-2005 01:52 AM

Is there a way to modify this so that you are buying avatars for users other than yourself?

Wifey 04-17-2005 08:24 PM

I forgot to post - I ended up reverting everything on my own and that worked, so you were right!

asianboi 04-27-2005 05:26 PM

Hello

so this is for the Upload Custom Avatars only. Is there a way to make it active in the generic avatars folder?

Link14716 04-27-2005 10:39 PM

Quote:

Originally Posted by asianboi
Hello


so this is for the Upload Custom Avatars only. Is there a way to make it active in the generic avatars folder?

As the action says, it is for custom avatars. ;)

carolmyt 05-11-2005 09:58 PM

I have two members now who say that they bought an av, and it took the points, but the new av didn't show. I've tested it after both complaints, and it worked fine for me, so i'm not sure its actually a problem with a hack, but i thought i'd mention it and see.

007 05-11-2005 11:47 PM

Just do what I'm doing. Wait for the new uShop.. *Don't know how much longer I can wait though!!* :(

carolmyt 05-12-2005 05:13 PM

Actually, I think I'm gonna stick with what I'm doing, which is asking if this is something that's come up before, or what possible cause other than user delinquency could be the issue.

Now its 3 members. One of them was trying to uploaded an animated gif. The file is within size and byte constraints. Is there any reason an animated gif wouldn't upload?

The hack is taking there money, and listing the exchanges as successful, the new av just isn't appearing. Any reason why this would be happening, it'd be nice to know.


All times are GMT. The time now is 04:52 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.01208 seconds
  • Memory Usage 1,785KB
  • 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
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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