Wednesday, January 25, 2012

[PHPBB MOD] Facebook like button in each topic / thread

This mod adds a facebook like button to each topic.
Tested with phpBB 3 (But there is no version dependent code, so it will work on all versions, if someone tests in other versions, please post the errors/success messages here)

Screenshot:


Steps:
1. OPEN FORUM_ROOT/includes/functions.php

2. FIND THE BLOCK:
--------------------
// Send a proper content-language to the output
    $user_lang = $user->lang['USER_LANG'];
    if (strpos($user_lang, '-x-') !== false)
    {
        $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
    }
--------------------

3. ADD BELOW:
--------------------
//Facebook like hack by Sriram.A.S. (sriramdasty7@gmail.com)
$pieces=explode("?",$user->page['page']);
if($pieces[0]=="viewtopic.php")
{
$curr_url=generate_board_url() .'/'. $pieces[0]."?";
$pieces=explode("&",$pieces[1]);
$flag_tmp=0;
foreach($pieces as $temp_x)
{
if(substr($temp_x,0,2)=="f=" && $flag_tmp==0)
{
$curr_url=$curr_url.$temp_x;
$flag_tmp=1;
break;
}
}
foreach($pieces as $temp_x)
{
if(substr($temp_x,0,2)=="t=" && $flag_tmp==1)
{
$curr_url=$curr_url."&".$temp_x;
break;
}
}
}
--------------------

4. In the same file, FIND
--------------------
'SITE_LOGO_IMG'            => $user->img('site_logo'),
--------------------

5. ADD BELOW
--------------------
'CURRENT_URL'      => $curr_url,
--------------------

6. SAVE file with changes

7. OPEN FORUM_ROOT/styles/{YOUR_TEMPLATE}/template/viewtopic_body.html

8. FIND FIRST OCCURANCE OF THE BLOCK
--------------------
<div class="buttons">
    <!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
--------------------

8. ADD BEFORE
--------------------
<div align="right">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="{CURRENT_URL}" show_faces="true" width="450"></fb:like></div>
--------------------

9. If you want the like button also in bottom, fine the second occurance of the block and also add accordingly

10. SAVE file with changes

11. Now, Login to Administration Control Panel from frontend and in the main page,
Resynchronise or reset statistics-->Purge the cache-->Run now

If you face any problems, post here.

Tuesday, January 24, 2012

Web Programming using C / C++

Here is a small API in form of header file in C / C++ which will allow simple programs to be converted into web programs and can be run through a browser.

The guide is written in such a way that each and every step is explained carefully for people who are mainly from non computer origin. This will help you to create simple web pages and do some web server scripting.
The guide explains from downloading required softwares, configuring them, writing simple C web apps. It will be a good thing for non IT people who work with simple C. Now do anything in C code, and atlast send the outputs to browser, make it a web app!!

Please post any bugs/suggestions/feedbacks here. Thank you.

Download Link:
http://www.4shared.com/zip/IVyKtfue/web_scripting_using_c_c.html  (COMPLETE FILE, API, Example, Tutorial Guide)
OR
http://www.mediafire.com/?fjhyzmr73nncuj1

IMPORTANT: If you have the older release, the file home.c in examples directory, will fail to compile because of a line disableCache(); in it, please remove the line and compile the file. Initially i kept a function for cache management in the API and finally i thought of removing it, but forgot to update that file. Thankyou.

Thursday, January 5, 2012

Rise of planet of "Hobby Coders"

Passionate about coding? Want to work on something interesting (probably :P), and chase some unseen problem?? Well, welcome to the world of Hobby Coders.

Wondering what it is? Honestly, i myself dont know the answer fully as of now! :) But it will be a NON PROFIT team (not a company, not even an organization, just a team) of DEDICATED coders who are thinking to do something useful in coding in their leisure time (just a part of your leisure time, not even full leisure time)
So, if you can give us, say, 15 or 30 minutes a day, and is willing to join me, please let me know.
And BTW, Im not so rich to give you salary, its not a company or something that works for profit. Its about passion, dedication and learning. Anytime you can join me and if you want to leave sure, anytime!!

Who are you anyways? Im Sriram, nothing much to say about me. I try to learn work on stuffs like Computer Vision, Artificial Intelligence, Virtual Reality, Neural Networks, Distributed Systems. Im not an expert in anything, but i keep on learning and think of some new projects, products to be more accurate!

I know more than you! Why should i work under you? Well, i still didnt say, im going to lead the team. IT is an area where each and everyone will have a unique talent and unique approach for a problem. This team will not worry about who is going to lead, who is going to get name and fame, but we will work on what we are going to do. All products will have the list of people who have worked for it. Thats it. Its more a friendly team, not something that has a hierarchy of positions

Do you think this idea will be a success? Im not going to boast about this attempt, may be we will make some good products, or may be the attempt will loose focus with time, atleast you will take knowledge and learning with you

So what we will do? We will take some small and challenging problems and we will give code solutions for that, also we will release few projects in some areas for free
The activities are not yet planned, i want to see how many people are interested, if i get enough strength, then we will proceed, otherwise, this will be shutdown!
But to give an example of projects that we will work, may be we will make a web based script for hotel management, may be a small and efficient memory management algorithm, may be a data over voice system for data communication (currently planning), may be a javascript library for better image processing and lot more

I also want the help of experts in many domains like neural networks, image processing, computer vision, programming languages and so on. You dont even have to spend more time, atleast please guide us for our future ideas

If anyone interested, please email me your details: sriramdasty7@gmail.com
Based on the total participation and the level of expertise we get, further activities will be planned

Thanks and Regards
Sriram.A.S.
B.Tech[IT]
NIT Raipur 2011 Passout
sriramdasty7@gmail.com

Wednesday, October 5, 2011

Web Scripting using C language

Web Server Side Scripting using C language

Many languages like PHP, ASP are used for web scripting, many programmers who are familiar only with C language are not from computer science origin refrain in learning these languages thinking that they are very complicated. For creating simple scripts and making your own websites, even C language is more than enough. Im planning to write a simple header file that C programmers have to include, and they can do all the basic web fundamentals.

And regarding optimization, im planning to write a small engine that can cache many files in it so that very fast processing of data could be possible because anyways these files are not interpreted like many web scripts. Definitely any server-scripting language like PHP will be better than this approach as they have a rich collection of libraries and many more. But this idea is targeted only people who are familiar only with C and want to do simple web scripting and database operations. I will start this soon and post it when it will be over. The first release will have only all basic commands required to convert simple C to simple server-scripting language, already MYSQL and other leading database vendors have given APIs for C to connect to their databases.

The first release will not have much validation techniques and data security algorithms in it.

!! Further Discussions in that Page !!

Tuesday, July 12, 2011

HTML Textarea new line problems with PHP

Many of the beginners face problem with textarea new line. When you save some data in textarea, you may write data beautifully in many lines (by giving {ENTER} key, new line), then when you save the data inside any database, and when you retrive and display that data, you will notice that, all new line startings are lost.

This is because when you press ENTER and give a new line character '\n' character is used inside textarea. But when you print it back, HTML cannot recognize '\n' character. PHP comes with a handy solution for this. There is a function called nl2br(),which replaces all \n characters with <br/> hence all new lines appear in HTML again!
Its not the only solution, you can also use explode function or something similar to find \n and replace it with a <br/> to comply with HTML

Eg:
<?php
echo nl2br("Sachin\nis great");
?>

Output:
Sachin<br/>is great

Now
<?php
$textarea_data=DATA_FROM_DATABASE;
echo nl2br($textarea_data);
?>
will work for textarea data!

Unity 3D handVu Integration Tutorials

Again Im really sorry for taking a long time for releasing this awaited tutorials with all working codes.

Since I dont have web space of my own, I rely on free file hostings, I have uploaded the required files with the mirrors::
Demo:
http://www.youtube.com/watch?v=-GxykrIB3yM


Tutorials PDF file:
http://www.megaupload.com/?d=6MDTU0CR
Full Project (Unity Package File):
http://www.4shared.com/zip/Wl-VFYjx/HandVu.html
OR
http://www.mediafire.com/?f55zs8gfzmf9clq
OR
http://www.megaupload.com/?d=F9OYMOSB

Download the PDF file, that contains links of files to be downloaded...

Saturday, July 2, 2011

VLC Current Track to Google Talk Status [VLC2GTalk v1.0 BETA]

I made one small script that checks VLC for the current track and sends this track name to Google Talk so that your google talk status gets updated with the current VLC track. This is similar to plugins available for Google Talk with ITunes, Winamp and so on.

I created this small script because i use VLC, im a music lover, so i listen to songs in 200% volume, which is available in VLC only, so i use VLC and then thought of developing a small script for posting the current track to Google Talk

Screenshot:


Here is the download link: (514 KB)
http://www.4shared.com/zip/RCD5E9Fh/VLC_to_GTalk_Status.html
OR
http://www.mediafire.com/?l2c3lusc2pukr53
OR
http://www.megaupload.com/?d=G1EVEVG2

And for coders, here is the source code: http://hobbycoders.com/products/vlc2gtalk/VLC2GTalk.ahk
(Its an AutoHotKey code)

I just checked it and it works, if you find any bugs please post it here, so that we can try to resolve them. This small software will be useful till a good programmer develops a good plugin for VLC GTalk status or Google allows VLC tracks too :)!!

BTW, The only problem with this that i face as of now is, when the song changes, an UI activity is performed, so so, for a moment, the focus is removed from your current focused object. Thats annoying, i know...the next release will be free from these problems

Anyways, if anyone wants to try developing the same. The idea is this:
1. Use high level language to poll VLC process in the system and detect song changes (VLC sets the song name as process title as SONG_NAME - VLC Player :)
2. Google provides codes for jabber client XMPP so that you can directly communicate with Google Talk and set the track as stauts