Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - feeble

Pages: [1]
1
Modifications / Mod: Bad Spelling Tax
« on: July 02, 2007, 06:17:48 pm »
This mod require Spellchecking to be enabled and working correctly.

What it does: For every word that is spelt incorrectly, user loses 2 times Per Word Bonus.

WARNING: If you make this change, you might find that SMFShop will have issues uninstalling and updating to future version. To correct this, you will need to take this out when you go and uninstall or patch.

open Sources/Post.php
Find
Code: [Select]
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));

Add After
Code: [Select]
if(!empty($modSettings['enableSpellChecking']) && function_exists('pspell_new')){
// Okay, this looks funny, but it actually fixes a weird bug.
ob_start();
$old = error_reporting(0);

// See, first, some windows machines don't load pspell properly on the first try.  Dumb, but this is a workaround.
pspell_new('en');

// Next, the dictionary in question may not exist.  So, we try it... but...
$pspell_link = pspell_new($txt['lang_dictionary'], $txt['lang_spelling'], '', strtr($context['character_set'], array('iso-' => 'iso', 'ISO-' => 'iso')), PSPELL_FAST | PSPELL_RUN_TOGETHER);
error_reporting($old);
ob_end_clean();

// Most people don't have anything but english installed... so we use english as a last resort.
if (!$pspell_link)
$pspell_link = pspell_new('en', '', '', '', PSPELL_FAST | PSPELL_RUN_TOGETHER);

$known_words = array('smf', 'php', 'mysql', 'www', 'gif', 'jpeg', 'png', 'http', 'smfisawesome', 'grandia', 'terranigma', 'rpgs');

$plaintextExploded = explode(" ", $plaintext);
foreach($plaintextExploded as $k => $v) {
   if (!(pspell_check($pspell_link, $v) || in_array($v,$known_words)))
  $points -= ($modSettings['shopPointsPerWord']*2);
}

}


If you have any issues, please let me know.

2
Items / Item: BuyAvatar
« on: June 05, 2007, 04:52:26 am »
THE ZIP IS NOT A PACKAGE, JUST EXTRACT IT INTO A FOLDER AND READ THE README
PLEASE READ THE README IN THE ZIP FIRST.
CLICK HERE TO DOWNLOAD V1
latest released: 05/JUNE/07

Initial Release

What this item does:
This item allows the user to buy their forum avatar, for a price ;)


Tip:
To use this item more effectively on your forums, deny your forum users the ability to select, upload or choose an avatar for their profile. You can find this option, under Permissions in the Admin area.


Quote from: readme.txt
Installation/Update notes:
1. Copy folders "items" into your Sources/shop directory on your website

I have created the directories for you in the zip file. just upload them into your forum directory.

Usage:
When adding the item, select one of the 3 choices. server stored, external or upload.
This will decide on the method the user will be able to buy their avatar once they buy and use the item


If you have any issues whilst using the item, let me know. Im sure there will be one or two.

3
General SMFShop Discussion / problem in item/steal.php
« on: April 03, 2007, 10:27:39 am »
coding error in steal.php

the problem is in this line here
Code: [Select]
return 'Steal From: <input type="text" name="stealfrom" size="50" />
<a href="' . $scripturl . '?action=findmember;input=username;quote=0;sesc=' . $context['session_id'] . '" onclick="return reqWin(this.href, 350, 400);"><img src="' . $settings['images_url'] . '/icons/assist.gif" border="0" alt="' . $txt['find_members'] . '" /> Find Member</a><br />';

4
General SMFShop Discussion / SUGGESTION: changing how items store info
« on: March 08, 2007, 06:09:30 pm »
Suggestions only daniel15, but im finding having only 4 possible info that can be stored for an item is limiting.

is it possible in a future version, instead of putting the data into 4 separate columns, instead just store them in one column under a serialized array of information.

that way we can store much more information.

pretty please and all that.

basically all im asking is storing a serialized array of the $_POST array, then unserializing into $item_info when the getUseInput function is called.

5
Bugs / mysql bug - either php 5 or mysql 5 problem
« on: March 08, 2007, 03:21:47 pm »
been getting
Code: [Select]
Database Error: Field 'trading' doesn't have a default value
File: D:\htdocs\Sources\shop\Shop-Buy.php
Line: 206

to fix your install daniel can you consider changing:
Code: [Select]
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}shop_inventory (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`ownerid` INT UNSIGNED NOT NULL ,
`itemid` INT UNSIGNED NOT NULL ,
`amtpaid` DECIMAL(8, 2) UNSIGNED DEFAULT '0.00' NOT NULL,
`trading` TINYINT(1) UNSIGNED NOT NULL,
`tradecost` DECIMAL(8, 2) NOT NULL,
PRIMARY KEY (`id`)
)", __FILE__, __LINE__);
to
Code: [Select]
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}shop_inventory (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`ownerid` INT UNSIGNED NOT NULL ,
`itemid` INT UNSIGNED NOT NULL ,
`amtpaid` DECIMAL(8, 2) UNSIGNED DEFAULT '0.00' NOT NULL,
`trading` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL,
`tradecost` DECIMAL(8, 2) DEFAULT '0.00' NOT NULL,
PRIMARY KEY (`id`)
)", __FILE__, __LINE__);

6
Bugs / bug in install_SMF1-1.xml
« on: February 24, 2007, 05:32:50 pm »
since this is my 6th time installing SMFShop and on both linux and windows and using php4 and 5 setups.

im pretty confident that this is a bug.

please refer to

Code: [Select]
<operation>
<search positon="before"><![CDATA[
'is_guest' => false,
]]></search>
<add><![CDATA[
// Begin SMFShop MOD Version New Version
'money' => $profile['money'],
// End SMFShop MOD
]]></add>
</operation>

please note that even thou it does say before and not replace, it is actually removing the line
Code: [Select]
'is_guest' => false,
im puzzled myself, but its been breaking a few other packages and thought i might mention it. its quite vexing.

would it be possible to change the code to
Code: [Select]
<operation>
<search positon="replace"><![CDATA[
'is_guest' => false,
]]></search>
<add><![CDATA[
'is_guest' => false,
// Begin SMFShop MOD Version New Version
'money' => $profile['money'],
// End SMFShop MOD
]]></add>
</operation>

for future versions.

7
is there a way, that if say, the script fails for a certain reason.
that it will give the item back to the user so that it will not be wasted?

if not, im thinking of, editing the Shop-Inventory.php that receives the return text.

if CANCEL is in it? then it will strip the cancel from the return, not deduct the item, and relay the message to the user, which is after CANCEL in the return.

something like,
return "CANCEL user doesnt exist, you decide not to waste it";

8
Items / Item: EggAvatar
« on: October 20, 2006, 11:07:41 pm »
THE ZIP IS NOT A PACKAGE, JUST EXTRACT IT INTO A FOLDER AND READ THE README
PLEASE READ THE README IN THE ZIP FIRST.
CLICK HERE TO DOWNLOAD V20R6
To PM
CLICK HERE TO DOWNLOAD V20R4
Or not to PM
latest released: 30/MAY/07[/b]
Main Release
Stores Egged Avatars in forum/egged/
Works on most hosts(free and paid)
Also PM's on successful egg, you can edit the msg by going in and editing the item.
You will find the section to edit at the end of the file


CLICK HERE TO DOWNLOAD V14
latest released: 08/MAR/07

Old Release
Stores Egged Avatars in forum/avatars/egged/
Works best on paid hosts


TIP: You can use buyAvatar Item to charge your forum members to change their Avatar

Essentially it Eggs a forums users avatar.

then(if admin allows) changes their custom title, to something like  "You've been Egg'd by {your name here}!"

Quote from: readme.txt
Installation/Update notes:
1. Copy folders "item_images" and "items" into your Sources/shop directory on your website
2. IMPORTANT: When you go to add this item into your shop. Please make sure that it passes
   both tests. If it doesnt, it should give you good enough instructions to fix the problem.
   If not please, follow the link at the bottom of this document, post up and I should beable
   to help you out.

I have created the directories for you in the zip file. just upload them into your forum directory.

Atm i have, an egg, snowball, tomato, a kiss, and a paint ball/splash. If you any any other ideas, please let me know, a of the said idea would also be nice but not necessary.

Requirements: you need GD, ill be putting a safety in soon, so that if you don't have it, it will let you know. and wont alter your forums.

How it works:
It gets your victims avatar, then using gd, overlays their avatar with an image, in this case an egg.

It will not override their old avatar on default settings, in fact it will store their new defaced avatar in avatars/egged/, so if you would like, you could also wear your victims defaced avatar, as a trophy, or something ;)

saved the images are saved in the format of:  egged_{memberusername}.gif

a nice feature of this script, is that you can egg as many times as you want, depending if you can afford that many eggs of course. It will keep piling the eggs onto the avatar. still working on the random script, but ATM its working decently.

It going to **** ppl off, but oh so worth it.

I also need someone to test it for me as well, as i may not have covered all possibilities of getting the users avatar. if someone could let me know, and ill send them the item. also if someone could go over the code that would be great.


Change-log from V13 to V14
-FIX:fixed the issues with users having spaces in their username. thanks to perplexed for pointing this out.
-ADDED: debug mode: ive added a debug mode in the EggUser.php file, so if you are having issues, just set it to true, then send me a pm on its read out next time you use the item.
-UPDATED: as per suggestion from TechnoDragon, ive made it so it will search for the users login name or realname, should make finding users a little easier. should of done this on the get go but better late then never.
---------V12Beta to V13------------
-FIX:fix a bug where egg details weren't being initialized properly on certain hosting. thanks xfollowthereaperx for the use of your forums.
---------V11Beta to V12------------
-Combined both v10 and v11Beta so if one fails, then it trys the other. Basically some forums work differently to others. this should cover most cases now.
-NEW EGG: added a snowflake for the xmas season
---------V10 to V11Beta------------
-REWROTE:completely rewrote how it gets the users avatar href. finally worked out the SMF function for this, so its now like 10 lines from 50. and should work better to.
---------V9 to V10------------
-NEW OPTION: adjust users karma based on what egg he throws.(default off)
-NEW OPTION: actually alter the victims avatar file if its not external. (default off)
-BUG FIX: fixed a few more forum errors.
-SPELLING CORRECT: corrected a few spelling mistakes or just plain grammar.
-AUTO CHMOD: added a funciton to check if egged directory exists and is writable. if not trys to create and chmod egged dir for you. with visual indicators.
-UPGRADE: eggs can now be png or gif formats.
-NEW EGGS: added a snowball and tomato
-few other bug and error fixes
---------V8 to V9------------
-Worked out what was wrong with the javascript so that it works in ie.
-apologies for 2 version within the hour.
---------V7 to V8------------
-Rewrote getting what type of image the avatar is. now 2KB smaller. yay. which means it can handle more ways of getting the file.
---------V6 to V7------------
-BUG FIXES: & in the avatar directory or file name or now handled correctly
-BUG FIXES: now uses the forums avatar directory instead of assuming avatars are stored in /avatars/. should solve a few ppl problems. and not sure why i didnt do this in the first place.
-NEW FEATURE: ive addeda a $donotcolourme variable at the top of egguser.php for ppl that add their own eggs. REMEBER 0 is the first item in the array. just play around with it, nothing bad can come from changing it.
-UPDATED: files are not stored with the users login name instead of using the form data.
---------V5 to V6------------
-BUG FIX: just fixes a few lines so you dont get forum errors building up
---------V4 to V5------------
-BUG FIX:slight edit to how the images were saved. solved a few problems of egged image not saving
---------V3 to V4------------
-IMPROVED: image preview now works in ie. i s****ped the taunt text changing when you selected a different egg, as i could get it to work correctly.bloody ie.
-BUG FIX: custom avatar directories should now work.
-improved: fixed the code. egged images should now retain aspect ratio of the original.
-degraded: my item code looks like **** now. yay for it.
---------V2 to V3------------
-FEATURE: Paintball, and kiss are now random in their color. basically anything not in position 1. anything not transparent will be the same color is how it works. look for paint ball edit and change the if clause there if you don't want it or change which images this will affect.
-FEATURE: preview image on getinput page for user, so they know what they are sending.
-EDIT: got rid of db_prefix as it was unused and spelt incorrectly. thanks chadk.
---------V1 to V2------------
-FEATURE: users are able to right their own taunt to be put in their victim custom title. Admin option.
-bug-fix: spaces in image file names are no properly found. thanks to Technodragon73
-improved: getting the users avatar as been improved. found an easier way, its not pretty ATM. ill rewrite it later. thanks to Technodragon73
-improved: overlayed gifs are now better proportioned if the avatar is not exactly square.
-improved: avatars now keep their correct aspect, but will be shrunk down to the maximum forum avatar size.
-improved: taunts, can now handle '. in them, but please keep the text simple in the php file, but users can write whatever they want.
-increased the default ratio size of the eggs, as generally the victim will only have 1, instead of many. now the paint looks better, since it covers a larger portion of the avatar.
-few other things not worth mentioning.

Wish List:
-dont change the avatar size if its not external - DONE - FIXED IN V4
-fix the javacript for ie users. stupid ie users - DONE - FIXED IN V4
-Different random colours for the paintball, and different shapes for it - DONE - ADDED IN V3
-add/minus system for the eggs. - may have found a way, ill look into it more when this one is done. thinking of adding a new table to smf_members for the data. then if image is not in egged, add eggs. not a perfect solution, but it may work.
-write your own message to replace your victim custom title - DONE - ADDED IN V2

Troubleshooting:
1. matkins70 - egged_{username}.png not being saved.
Solution: changed folder 'egged' in the avatars/ folder to 777. Solution is host dependent. All folders for myself are 755 and works fine. But definitely worth a go, if you are having this problem.
2."Error: Avatar is an unknown filetype"
Solution: please check your "Attachments and Avatars" in smf admin area. make sure Attachment/Avatars directory and avatar url does NOT have a trailing slash
EXAMPLE: Avatars Directory: /home/*****/public_html/avatars


Pages: [1]