Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > uCash & uShop
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
adding an action Details »»
adding an action
Version: , by khaleel khaleel is offline
Developer Last Online: Jul 2008 Show Printable Version Email this Page

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

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

bump

Show Your Support

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

Comments
  #2  
Old 01-22-2005, 06:20 PM
khaleel's Avatar
khaleel khaleel is offline
 
Join Date: Oct 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone
Reply With Quote
  #3  
Old 01-24-2005, 09:48 AM
khaleel's Avatar
khaleel khaleel is offline
 
Join Date: Oct 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #4  
Old 01-25-2005, 03:55 AM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, there are no tutorials.
Reply With Quote
  #5  
Old 01-25-2005, 04:30 PM
khaleel's Avatar
khaleel khaleel is offline
 
Join Date: Oct 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So .... how - do - i - do this?
Reply With Quote
  #6  
Old 01-25-2005, 06:59 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;

Attached Files
File Type: (21.4 KB, 16 views)
Reply With Quote
  #7  
Old 01-26-2005, 12:38 PM
khaleel's Avatar
khaleel khaleel is offline
 
Join Date: Oct 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 01-26-2005, 06:50 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 01-26-2005, 06:56 PM
Dan's Avatar
Dan Dan is offline
 
Join Date: Dec 2002
Location: Titusville, Florida
Posts: 1,787
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 01-26-2005, 07:03 PM
khaleel's Avatar
khaleel khaleel is offline
 
Join Date: Oct 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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:47 AM.


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.04807 seconds
  • Memory Usage 2,345KB
  • Queries Executed 24 (?)
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)bbcode_html
  • (2)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
  • (1)postbit_attachment
  • (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_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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete