softpedia

Yesterday I received an email from softpedia that they have added my plugin(custom comment) to their site 😀
Should I be happy? 😛

Advertisements

Leave a comment

custom comment future updates

Well when I fixed all of the bugs in this plugin I thought that now there is nothing left to do with this plugin
But when I walked out of the office I thought it would be good to add some more options
So let me explain to you what the future options be(As soon as I find some free time :D)
1- type of the extra field(number, string(min, max length), combo box, check box)
2- string validation(with regular expression)
3- show the extra fields in the post or not
4- send the extra fields to the email(along with the main fields)

These are what I thought until now
If you have anymore suggestion please tell me and I will add it here and of course I will mention your name in the code(with a link);)
This post will be a future reference for me to remember what I wanted to do with this plugin
p.s: If you make any improvement for the plugin send it to me in order not to lose the improvements when I update the plugin to a newer version
Wish me free time:P

, , , , ,

2 Comments

symfony standards

Hi everyone
As I told you before I started working a company which use symfony for most of its projects
Today they asked me to translate some parts of the script which were in English and it was done by one of my co-workers
I thought well I just go to the template and translate whatever I see in there
After finishing translating I refreshed the page… I think you can guess what the result was:P
It was just wasting time since like half of my time was used finding where he put the text that i needed to translate
Just a suggestion to you guys
Use the standards that symfony suggest you so when you work in groups it will be so much easier for other person to modify your code

Leave a comment

Symfony

It’s been a month since I started working
The company I work in uses symfony 1.4 for most of its projects
As I use more and more this framework It amaze me more and more
Right now I’m searching for a good idea for wp plugins
Any idea?:D

Leave a comment

Found a work!!

Hi everyone!
Yesterday a company called me and asked me to work with them(PHP and MySQL)
They pay 600 euros each month(80 hours)
I hope I get enough time to keep working for free plugin for you guys 🙂

And btw if you have any idea for plugin don’t hesitate to tell me

p.s:I just added a new option to CustomComment plugin(required fields) check it out:D

1 Comment

Drag Image

Hi everyone
Last week I got my new mac pro and started programming for iphone xcode 3.2
In this tutorial Brandon explains how to drag an image around the screen
In my case there was a problem in simulator(I don’t know if the same happens in real iphone or no)
In Brandon’ tutorial when you try to drag the image it doesn’t work well and the image jumps to the right upper corner of the screen
In jaipn’s comment he makes the code better but with the same problem

So i came up with this code which the image will be dragged perfectly(I used Brandon’s tutorial and jaipn’s improvement)
There is constant(ONLY_ON_OBJECT) that let you chose two different way of dragging
with ONLY_ON_OBJECT = 1 the image will be dragged only when you click on it
with ONLY_ON_OBJECT = 0 the image will be dragged even if you don’t click on the image

I couldn’t find an easy method to take the image’s width and height so I directly used image’s info(100×100)
I hope you enjoy this code

.m file

#import "iDragImageViewController.h"
@implementation iDragImageViewController
@synthesize cloud;
#define ONLY_ON_OBJECT 0
// 1 – drags only if touched location is inside the cloud’s rectangle
// 2 – offset from touched location to cloud center remains constant during the drag
-(BOOL) hitFirstSubview:(CGPoint)location {
BOOL hit = NO;
UIImageView *subview = (UIImageView *)[[[self view] subviews] objectAtIndex:0];
if (subview != nil) {
CGRect rect = [subview frame]; // in view’s coordinates
hit = CGRectContainsPoint(rect, location);
}
return hit;
}
// respond to touchesBegan – mouseDown
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.window];
BOOL hit = [self hitFirstSubview:location];
if ((cloud.center.x - 50 location.x && cloud.center.y - 50 location.y) || ONLY_ON_OBJECT == 0) {
isOnObject = true;
}
else {
isOnObject = false;
}
cloudTouchedOffset = CGPointMake(0.0, 0.0);
if (hit) {
CGFloat xPoint = cloud.center.x;
CGFloat yPoint = cloud.center.y;
cloudTouchedOffset = CGPointMake(xPoint - location.x, yPoint - location.y);
}
}
// respond to touchesMoved – mouseMove
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.window];
// in touchesBegan we stored the offset btw location and cloud.center (if hit)
// and now use it in dragging, so that center does not snap to the location
// move only if touch is inside the subview
if ([self hitFirstSubview:location]) {
//cloud.center = location; // basic
if (isOnObject) {
CGPoint newLocation = location;
newLocation.x += cloudTouchedOffset.x;
newLocation.y += cloudTouchedOffset.y;
cloud.center = newLocation;
}
}
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)dealloc {
[super dealloc];
}
@end

.h file

@interface iDragImageViewController : UIViewController {
IBOutlet UIImageView *cloud;
CGPoint cloudTouchedOffset;
BOOL isOnObject;
}
@property(nonatomic,retain) IBOutlet UIImageView *cloud;
@end

, , ,

3 Comments

More about CustomComment plugin

CustomComment plugin lets you to add more fields to comment form
When a user post a comment the extra fields data will be visible only to admin
In the setting page of the plugin you can add, edit, delete, activate or deactivate extra fields
With deactivating an extra field the data of that field won’t be removed but when you delete an extra field all associated data will be removed from comments.
For adding an extra field there are two input box
Name: is the identifier of the extra fields and you can see it only in the extra fields table(will be used as the key)
It should be unique and can only contain alphabetic letters, space and _
If you enter another character the plugin will remove that character
Description: This part will be visible in the comment form and can contain any character.

In the comments page you can see a link(Info) that will lead you to a page which you can see the value of extra fields of the user(if he has filled them)!

I hope you enjoy this plugin
To support the plugin please consider donation

10 Comments

Custom Comment

I really love programming plugins
It has just been 3 days that I have learned how to program wp-plugins
Yesterday I checked the Ideas page of wordpress and I saw an idea about letting users define more fields for comment form.
So I just tried to do it and after lots of searching I found all of the things i wanted!(What I needed was the actions and filters for comments)
Download

Read more about this plugin.

102 Comments

TIProtector

In following of the last post…
After finishing protect_content function I thought I can use it in wp too
So I tried to learn how to make a plugin for wordpress
At the beginning it was really hard but after an hour I got used to it And i finished writing a simple plugin in 5 hours(lots of time XD)
Download the plugin HERE
I hope you enjoy it
Have a good day

, , , , , ,

9 Comments

Protect Content Function

Hi everyone
Last night I wrote a function to protect content of my site
For whoever has a site and wants to use my function here is the function
* I used simple_html_dom class in this function, you can download it here Simple html DOM

function protect_images($text, $protect_images = true, $protect_text = true){
require("simple_html_dom.php");
$html = str_get_html($text);
$image_original = array();
$image_protected = array();
if ($protect_images)
foreach($html->find('img') as $element){
$src = $element->src;
$width = $element->width;
$width_p = $width + 2;
$height = $element->height;
$height_p = $height + 2;
$element->outertext = '

';
}
if ($protect_text)
return '

'.$html.'

';
else
return $html;
}
}

, , , ,

Leave a comment