vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   uCash & uShop (https://vborg.vbsupport.ru/forumdisplay.php?f=100)
-   -   adding an action (https://vborg.vbsupport.ru/showthread.php?t=74729)

khaleel 01-20-2005 11:01 AM

adding an action
 
Cant see any tutotrials or anything on how to add a simple action. I want to add a buy avatar action

bump

khaleel 01-22-2005 06:20 PM

Anyone

khaleel 01-24-2005 09:48 AM

Anyone?

Link14716 01-25-2005 03:55 AM

No, there are no tutorials.

khaleel 01-25-2005 04:30 PM

So .... how - do - i - do this?

Link14716 01-25-2005 06:59 PM

1 Attachment(s)
Well, assuming you know PHP and how vB adds an avatar, it shouldn't be super hard.

Here's an action file that _may_ work on 0.95b. Add it through the action manager.

EDIT: Removed some uCS 1.0.x only code. It needs a new template as well.

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>

This action probably has a few bugs though, so don't think that just because I am posting it that it is stable. ;)

EDIT2: You also need to change this 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;



khaleel 01-26-2005 12:38 PM

hey thanks!
but it says

There has been an error in the upload. Please ensure that the file has been correctly selected and that the upload has taken place successfully

when trying to upload any avatar :(

Link14716 01-26-2005 06:50 PM

Apparently you'll get that if you try to upload one (as opposed to getting it through a URL). I'm not sure why, though.

Dan 01-26-2005 06:56 PM

Quote:

Originally Posted by Link14716
Apparently you'll get that if you try to upload one (as opposed to getting it through a URL). I'm not sure why, though.

So the best thing we can do is WAIT untill we can get our hands on 1.0.x :D

khaleel 01-26-2005 07:03 PM

ill have to wait then, the new one should be great i hope we can buy things like avatars and items (pictures) that we can show as cars or products in the userprofile or even credit cards and usercshops like invisionboards and phpbbs

by the way i had to undo those edits as that stopped the shop completly working


All times are GMT. The time now is 05:09 PM.

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.01301 seconds
  • Memory Usage 1,770KB
  • 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
  • (1)bbcode_html_printable
  • (2)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