New features coming

Hi guys
After a long time I checked all the comments and fixed the problems that you guys reported to me
1- problem with deleting comments in wp 3.2
2- showing fields when the user is logged in

Right now I’m really busy as I have to work 20 hours per week and have like 20 hours of University classes :S
So what are the next features for the plugin to keep it up with nice features of wp 3.2 XD
1- Suggested in comments by Søren Sommerglæde
I will add a new field in the table which you edit the fields which can let you select a type for the field
2- It’s not a feature it’s like more cleaning up the plugin
I will change the name of the buttons and the look of the table to make it easier to unserstand
3- If possible I will add a more about this user link(or something shorter) to where the comment appears for visitors so other visitors can see the info of the user
4- If the feature #3 is added the will be an option to say which fields will be shown for the public and which will be only for the admin

I hope you enjoy this plugin ;)

Leave a Comment

jDupIt

Hi everyone
Today Im gonna show you my latest plugin(This one is in jquery:D)
So what does this plugin do?
It’s not really a plugin but an object that your form extends it then you can duplicate your fields remove them or add n number of them
Let see the object code


var jDupIt = {
fieldsElement: null,
initialize: function() {
newElement = $('#outer-fields-div').children('div.fields-div:first').clone();
newElement.hide();
this.fieldsElement = newElement;
},
addOne: function() {
newElement = this.fieldsElement.clone();
$('#outer-fields-div').append(newElement);
newElement.slideDown('slow');
},
bindAddOne: function(clickElement) {
formObj = this;
$(clickElement).click(function(){formObj.addOne()});
},
bindAddN: function(clickElement, inputElement) {
formObj = this;
$(clickElement).click(function(){
for (i = 0 ; i < $(inputElement).val() ; i++)
formObj.addOne();
});
},
bindRemoveCurrent: function(clickElement) {
$(clickElement).live('click', function(){
$(this).parents('div.fields-div').slideUp('slow', function(){$(this).remove()});
});
},
bindRemoveLast: function(clickElement) {
$(clickElement).click(function(){
$('#outer-fields-div').children('div.fields-div:last').slideUp('slow', function(){$(this).remove()})
});
}
};

And here is the html code

<form id=”factor-form” method=”post”>
<label>Factor Num: </label>
<input name=”num_fac” type=”text” />
<label>Address: </label>
<input name=”address” type=”text” />
<div id=”outer-fields-div”>
<div class=”fields-div”>
<label>Referencia: </label>
<input name=”references[]” type=”text” />
<label>Precio </label>
<input name=”prices[]” type=”text” />

<a>
<img src=”images/cross.png” width=”16″ height=”16″ border=”0″ />
</a>
</div>
</div>
<input type=”submit” value=”ok” name=”submit” />
</form>
<!– Controls –>
<div id=”controls”>
<div id=”add”><a><span>Add One</span></a></div>
<div id=”remove”><a><span>Remove</span></a></div>
<div id=”add-n-div”>
<div id=”add-n”><a><span>Add</span></a></div>
<input id=”add-n-num” type=”text” size=”4″ /> products
</div>
</div>
<!– /Controls –>

Be careful

You can name every element as you like but 2 of them

<div id=”outer-fields-div”>
<div class=”fields-div”>

The first one is to know where the dynamic fields are and the second one is to know which fields to duplicate

Which means the second one contains the dynamic fields and the first one contains nothing or one or more blocks of second one

So what should you do to use the object?

element = $('#factor-form');
jQuery.extend(element, jDupIt);

First your form extends jDupIt then you bind the buttons or links to the actions


element.initialize();
element.bindAddOne('#add');
element.bindAddN('#add-n', '#add-n-num');

(#add-n-num is the id of the input that indicates the number of times that you want to duplicate the fields)

element.bindRemoveCurrent('.remove-current');
element.bindRemoveLast('#remove');

Do not forget to call element.initialize since it’s necessary
I hope this plugin be helpful for you

Leave a Comment

Facebook vs. Google+

So as you know it’s been a long time that facebook and google had some fight about the email and social network system.
So google finally has made his move and launched the invite-only testing phase to test it’s new system
I was amazed by it
The interface and the way you do things in Google+ is totally different from Facebook
Lately I was really unhappy about the problem with the Facebook(When you watch videos from YouTube and then decide to see a pic after opening the pic all the videos restart and start to play again)
Google offers lots of things that Facebook hasn’t offered even after 7 years and one of them which I hate it so much is the limit in status that Google seems to have more limit or not any limit at all(I have tried with more than 3300 characters and I guess it’s unlimited)
So why Facebook gonna lose to Google+?
We can’t deny the quantity of the people that are using Facebook right now(more than 500 million)
But Google is like a monster that has gotten over the whole internet and there is no way for Facebook which is a one service website to challenge such a monster
And the other thing is if you have a Gmail(You probably have) then once Google+ is public you will see the notification and everything needed for Google+ in the bar at the top of the page when you are using Google to find what you need
Soon you will be able to see why I love Google+ so much
Right now just there aren’t lots of people in Google+ from my friends but once it is public I’m not going to use Facebook anymore:)

Leave a Comment

Best hosting

Well since I introduced you the svn server so it’s better to introduce you to a good pricing shared hosting too
It’s been more than a year that I have my site hosted by this hosting and I’m really happy about their support and service
The only bad thing about this hosting is the domain price since in comparison to other hosts it’s really high($12 + tax)
So what I suggest you is to host your domains in a server that have a good pricing for domains and the change the dns to this host
The management of external domains is really really easy and I’m sure you will be happy with their services
Host your Web site with iPage!

1 Comment

Best svn server

Hello everyone
Today I’m going to introduce you to the server that I have been using for a year and I’m really happy with them(Well recently they had lots of upgrades so they sometime were down due to these upgrades)
But for my personal website which has like 700 800 unique visitors per day I’m really happy with their service(And the company which I work in, uses this server for more than 20 large project)
It’s called Springloops(Don’t ask what it means:D)
So what’s good about this server
Once you have your project uploaded in this server you can give your server ftp access(It can be a shared hosting!!) and with a once click you have the whole project in the given directory in your host
I know the prices seem to be a little rare but I suggest you the GARDEN plan
You can get a free plan for minimum features to check whether it meets your expectation or not(And even 28 free trial days only through this link -normally it’s 14 days-)
Just check it out
They won’t ask you for any credit card for the trial so don’t be afraid and use it;)
Springloops

Leave a Comment

Domain

I always hated the domain business and never liked it
When I hate it when someone buys a domain and doesn’t use it and just waits for someone to pay him a large amount of money
And now I just wanted to check is http://www.imaprogrammer.com/ is still free or not
And guess what!!
It was registered in January the month that my blog got more active(I had this blog from September 2010)
I would be happy if it was a page with some content but it’s not and I’m sure that person is waiting for someone to pay him good for the domain
Well I hope he waits until the end of his life :D

Leave a Comment

Showing custom comments saved values to visitors

Hi everyone
It’s been a long time since I wrote something
Due to requests for showing the custom fields in the template I searched a little bit and finally found the easiest solution
So what should you do?

First of all
Go to you template directory (in default template it’s “wp-content/themes/twentyten”)
Second
Open comments.php and search for “wp_list_comments”(Don’t search with quotes :P )
Third
Do you see the “something” in wp_list_comments( array( ‘callback’ => ‘something’ ) );?
That’s the function that will be overwrite the default template for comments
If it’s not there add it and instead of something write the name you like
Fourth
Now open functions.php
If you haven’t changed anything in comments.php so search for “something”(the name of the function)
Now you you should add this code to this function wherever you want(put it in different place to see where it will appear-at the beginning it will be before author and at the end after the reply link-)

The function


$CComment_fields = array_filter(explode(",", get_option('CComment_fields')));
foreach ($CComment_fields as $CComment_field){
$CComment_field_arr = explode(";CuCo;", get_option($CComment_field));
$CComment_field_desc = $CComment_field_arr[0];
$CComment_field_active = $CComment_field_arr[1];
$Comment_field_value = get_comment_meta(get_comment_ID(), "CuCo_".$CComment_field);
if ($CComment_field_active == 1)
echo $CComment_field_desc.' : '. (($Comment_field_value[0] != '') ? $Comment_field_value[0] : '-');
}

Do you see this line “echo $CComment_field_desc.’ : ‘. (($Comment_field_value[0] != ”) ? $Comment_field_value[0] : ‘-’);”?
It’s the part that prints each of custom field and it’s value
Just play with it as you please(add class, id or whatever you want)
For example
echo ‘
<div class=”cc-field”>’ . $CComment_field_desc .</div>
. ‘ : ‘. (($Comment_field_value[0] != ”) ? $Comment_field_value[0] : ‘-’);
I hope this helps
Thanks for all of the comments about this plugin :)

, , ,

2 Comments

symfony & svn & Linux/Unix

I know lots of people use symfony in Linux or Unix operating system as we all know right now there isn’t any free program to use like tortoise in windows.

Yesterday I finally found a good solution.

This bash script simply search through all the files that are not under version control and it simply ignores the files under cache, log and config folder.

I hope it helps you out.
(make a file with sh extension the chmod it to 755 and put it in the parents folder to avoid adding it to the version control)

svn st | grep “^\?” | grep -v config | grep -v cache | awk “{print \$2}” | xargs svn add $1

, , , , , , ,

3 Comments

softpedia

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

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

Follow

Get every new post delivered to your Inbox.