Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Code Snipped Database

Post Reply
Fundi
Posts: 27
Joined: Sun Apr 17, 2011 10:22 pm

Code Snipped Database

Unread post by Fundi »

Hi all
nuBuilder is very helpful in many ways and caters also for the needs of people who may not read programming languages like other people newspapers. One of the strength of using Access in the past was the code samples available from various websites for making the application do what you wanted. With nuBuilder snippets of JavaScript and some short php function or a clever mysql statement a nuBuilder app really comes to full functionality. Some time it is just a single line of code.

For the versed programmer it is easy to generate ones own code, but for the humble beginner it is a huge challenge sometimes. To be able to look for code that others have written would be a great help. The sample databases help in this regard as one can look up what has been done there, but there is no explanation with it and sometimes it is not easy to understand why it is done that way.

So I wondered if a little nuBuilder application collecting code snippets would not be helpful for the nuBuilder community? If interest would exist I would be willing to give it a shot and make it available so that other could also contribute and with time it would be a valuable tool for many.

Let me know what your take is on this idea.
alvin
Posts: 9
Joined: Sat Apr 16, 2011 6:49 am

Re: Code Snipped Database

Unread post by alvin »

You have my vote. I think it is a great idea. :D
cypherinfo
Posts: 125
Joined: Thu Feb 18, 2010 5:42 pm
Contact:

Re: Code Snipped Database

Unread post by cypherinfo »

One thing is an application able to quick manage milion of records without the record lock, another thing is a user friendly application that stall with that number of item!
admin
Site Admin
Posts: 2784
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 3 times

Re: Code Snipped Database

Unread post by admin »

cypherinfo,

I'm not sure I know what you are saying.

Is it about code snippets?

Steven
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: Code Snipped Database

Unread post by zazzium »

This is a good idea ...I'll start then (It's not exactly Code Snipped but I hope that it helps someone)

I needed a calendar to keep an overview of certain entries.
I know that nuBuilder is not intended for that, but it doesn't bother me :)

There are many solutions, but the best I found for me was
activecalendar class from Giorgos Tsiledakis
http://www.micronetwork.de/activecalendar/

the Classes can be placed in Code Library (there are 2 class files, I put them bouth in to one library file).
I called the class in new form window in Before Open section, and placed it with css.

Before Open:

Code: Select all

echo"<link rel='stylesheet' type='text/css' href='productionnu2/style/default_wide.css' />";
$myurl=$_SERVER["REQUEST_URI"];
$yearID=false; 
$monthID=false; 
$dayID=false;
extract($_GET);
$cal=new activeCalendar($yearID,$monthID,$dayID);
//View samples to insert events
$cal->enableYearNav($myurl); 
$cal->enableWeekNum(); 
$cal->enableMonthNav($myurl); // this enables the month's navigation controls
echo "<div style='z-index: 5; position: absolute; top: 110px; left:20px; '>";
echo $cal->showMonth(); // this displays the month's view
echo "</div>";
looks like this:
Image

Note the entries are called from mySql and the links contain 'openForm(pFormID, pRecordID)' JavaScript Function
and open up corresponding entry (the first is not posted invoice and the second is customers birthday)

it's not the most elegant solution but it works.
admin
Site Admin
Posts: 2784
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 3 times

Re: Code Snipped Database

Unread post by admin »

zazzium,

Very Cool!

Steven
admin
Site Admin
Posts: 2784
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 3 times

Re: Code Snipped Database

Unread post by admin »

OK

THERE IS NOW A CODE SNIPPETS LIBRARY AVAILABLE!

http://www.nubuilder.com/index.php?nav=codesnippets

Steven
Post Reply