Jquery Imageflow iPhone Photo rotation

Cool thing I found and broke it up for easy copy and use... Check out the code below and the links. Just grab the js and css files yourself off my server...

Take a look at the ImageFlow IPhone like Photo viewer you can view the source and get the goods, but below is the just of the code:

In the HEAD tag:

<link rel="stylesheet" href="imageflow.css" type="text/css" />
<script type='text/javascript' src='jquery.js?ver=1.3.2'></script>
<script type='text/javascript' src='jquery.cycle.js?ver=1.0'></script>
<script type='text/javascript' src='jquery.thumb-hover.js?ver=1.0'></script>
<script type='text/javascript' src='imageflow.js?ver=1.0'></script>

<script type="text/javascript">

 jQuery(function($){
  
  //sliding content
        $('#image').cycle({
   timeout: 5000,
   fx: 'fade'
  });
 
 });
 
 </script>

Then somewhere in the BODY TAG:

<div id="slider" class="imageflow">
   <img src="images/1.jpg" width="600" height="450" alt="One" />
   <img src="images/2.jpg" width="600" height="450" alt="Two" />
   <img src="images/3.jpg" width="600" height="450" alt="Three" />
   <img src="images/4.jpg" width="600" height="450" alt="Four" />
   <img src="images/5.jpg" width="600" height="450" alt="Five" />
   <img src="images/6.jpg" width="600" height="450" alt="Six" />
   <img src="images/7.jpg" width="600" height="450" alt="Seven" />
   <img src="images/8.jpg" width="600" height="450" alt="Eight" />
   <img src="images/9.jpg" width="600" height="450" alt="Nine" />
   <img src="images/10.jpg" width="600" height="450" alt="Ten" />
   <img src="images/11.jpg" width="450" height="600" alt="Eleven" />
 </div>

You can have as many images as you like, but they do "pre-load..." Have fun!

 

 

Plat Maps Plot Maps Parcel Boundaries

A new service was just release (BETA) for Florida county plat maps, Florida county plot maps, Florida county parcel boundary maps.

Really cool application. Check it out: Florida County Plat, Plot, Zoning, Parcel Boundary Maps

Technologies used: Google Earth Plugin, KML, Google Maps, Mobile device support for Android and iPhone platforms. Search the entire state of Florida for parcel boundaries, owner information, Google Street View, etc...

Blackberry BB Curve Facebook Photo Upload

Facebook downgrade

Ok I had an issue with my new Blackberry curve and Facebook. The photo upload sucked! So I did some research and I found a post for version 1.5 of Blackberry Facebook software.

Version 1.5 is the version that worked!!! Here is a link to my zip file that worked. And here is the post. Note my zip file was for BB 4.5, not 4.6, BUT the post has both versions...

Full Text Index on SQL Express

On SQL Express I had to do the following to get FULLTEXT index setup. I also had to make sure there was a primary key, then I went to the design of the table and right clicked on the primary key (or any colum) and select the fulltext index, when the dialog came up on the right side I selected the columns I wanted to add, click close and I was set...

use mydatabase

exec sp_fulltext_database 'enable'
go
exec sp_fulltext_catalog 'tblMyTable', 'create'
go

Javascript clickable slideshow

I did NOT write this, I wanted a javascript slidshow to show off project screen shots and found this code and wanted to make sure I had it in my archives to search for later! Got this off: http://www.javascriptkit.com/howto/show3.shtml 

in head:

<script type="text/javascript">
<!--
//preload images
var image1=new Image()
image1.src="images/screenshot.jpg"
var image2=new Image()
image2.src="images/screenshot2.jpg"
var image3=new Image()
image3.src="images/screenshot3.jpg"
var image4=new Image()
image4.src="images/screenshot4.jpg"
//-->
</script>

In the body where you want the "images" to show up...

<a href="javascript:slidelink()">
<img src="images/screenshot.jpg" name="slide" border="0" width="492" height="354" /></a>
<script type="text/javascript">
<!--
var step=1
var whichimage=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
whichimage=step
if (step<4)
step++
else
step=1
setTimeout("slideit()",4000)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="page1.html"
else if (whichimage==2)
window.location="page2.html"
else if (whichimage==3)
window.location="page3.html"
else if (whichimage==4)
window.location="page4.html"
}
//-->
</script>

Javascript select ASP.NET Checkboxlist items

Ok I needed a function that would select certain CheckBoxList items of an ASP.NET CheckBoxList, so here it is, hope is helps someone else out!

if you want I use this function hightlight the item in yellow:

function uStyle(cb) {
   cb.parentNode.style.backgroundColor = cb.checked ? "yellow" : "";
   cb.parentNode.style.color = cb.checked ? "blue" : "";
}

function doCertainOnes(cbControl) {

    var chkBoxList = document.getElementById(cbControl);
    var chkBoxCount = chkBoxList.getElementsByTagName("input");

    chkBoxCount[5].checked = true;
    chkBoxCount[5].focus();    //GOING TO JUMP DOWN IN THE LIST TO THE FIRST SELECTED       
    uStyle(chkBoxCount[5]);
    chkBoxCount[6].checked = true;
    uStyle(chkBoxCount[6]);
    chkBoxCount[7].checked = true;
    uStyle(chkBoxCount[7]);

  
  for (var i = 10; i < 50; i++) {
       chkBoxCount[i].checked = true;
       uStyle(chkBoxCount[i]);
    }
}

I am selecting items (array) 5, 6, 7 and 10 through 49 in the list, now you can repeat the for loop and select different ones to. I happen to know that there will always be 100 items in the checkbox list and which ones they are... I use the "focus()" function to jump to the first item selected in the list...

Use it like this:

<a href="JavaScript:doCertainOnes('<% =CheckBoxList1.ClientID %>');">Select My Favs</a>

ASP.NET cookie auto log in

Ok it is NEVER a good idea to store a cookie on a client's machine with an ID or username and password in the cookie. Can steal the cookie. Come on, cookies are good to eat, chocolate chip cookies are my fav! Anyway, take a look at this, I think joomla does this and I don't take all the credit, but this works great:

1. Obviously a login.aspx page with a checkbox to save my login.

2. Evertime the user is logged in, either themselves or through the cookie, it deletes the old one in the table and writes a new one in the table and updates the client's cookie, or adds the cookie on the client

I call this function when the log in is successful

Public Sub doChocolateChipCookies()

        Using cooks As New dsTableAdapters.cookiesTableAdapter (I use dataset object)
            Dim q, s, t As String
            Dim expires As Date

            q = (a GUID the is stored in the user table) STORED IN THE USER TABLE
            s = (this is the current sessionID from the server I save) STORED IN THE USER TABLE
            t = RandomQIDNumber() (see function below) THIS IS NEW EACH TIME

            Dim dt As New Data.DataTable
            dt = cooks.GetDataByExpires(q)
            If dt.Rows.Count > 0 Then
                expires = dt.Rows(0)("expires")
            Else
                expires = Date.Today.AddDays(90)
            End If
            dt.Dispose()

            Response.Cookies("epauth")("epq") = q 'guid to look up user to log them in with
            Response.Cookies("epauth")("eps") = s 'series to match with token from db and cookie sent
            Response.Cookies("epauth")("ept") = t 'token to match with db and cookie
            Response.Cookies("epauth").Expires = expires

            'if the "s" does NOT match "t", someone could have stollen the cookie we will clear all cookies from the db
            'and require the user to login again...

            'remove any old cookies from db
            cooks.DeleteQuery(q, s) on every login, or cookie login, see later in this post, we delete old cookies out of the table

            'add new one
            cooks.Insert(q, s, t, expires)
        End Using
    End Sub


Public Function RandomQIDNumber() As String
        Return String.Format("{0}{1}", System.Guid.NewGuid, Now.Second)
End Function


Ok, now when the session expires because I store info in session and in a session table in SQL 08 (my sessions are stored via SQL, not cookie based) I call this function and pass in the cookie if a cookie is found

If Not Request.Cookies("epauth") Is Nothing Then
   If Not checkChocolateChipCookie(Request.Cookies("epauth")) Then
                        Session("epexp") = "y"
                        Response.Redirect("login.aspx")
    End If
End If


Public Function checkChocolateChipCookie(ByVal cookie As HttpCookie) As Boolean

        Dim cooks As New dsTableAdapters.cookiesTableAdapter
        Dim q, s, t As String
        Dim dt As New Data.DataTable
        Dim bln As Boolean

        q = cookie.Item("epq")
        s = cookie.Item("eps")
        t = cookie.Item("ept")

        dt = cooks.GetDataByAuth(q, s, t) so I have a cookie table in the db and a ds routine that gets a table by all three values
        If dt.Rows.Count > 0 Then
            'lets setup a currentuser
            Session("CurrentUser") = New objUser(q) I have an objUser class
            doChocolateChipCookies() setup a new cookie delte the old one
            bln = True
        Else
            'possible security issue, remove all
            cooks.DeleteQuery1(q)
            bln = False
        End If
        dt.Dispose()
        cooks.Dispose()
        Return bln

    End Function


Hope this helps!

WebForm_DoPostBackWithOptions vs __doPostback

Hi there guys, had an issue with WebForm_DoPostBackWithOptions vs __doPostback. WebForm_DoPostBackWithOptions started showing up on a page and not showing up on other .NET pages. It was a pain in my butt! Because WebForm_DoPostBackWithOptions wasn't working, all my linkbutton had this javascript function rendered and none of the events were firing!

So after looking around I found out that I had some panels that were hidden on the page. And in one of those panels, I have a validation control, if a validation control is "hidden" on the page (the panel's visibility is set to false and later made visible) then .NET adds WebForm_DoPostBackWithOptions to the button controls and thus does not work.

To fix this I had to change the linkbuttons that were not hidden to cause validation to false. (CauseValidation=False). Once I did that, it work! What a pain in the butt!

Over 13 years of Internet experience and website marketing. Tim Maxey's Tech Blog. Set out to help the lives of others by making their programming easier. No one is the "best" programmer, every good programmer knows that, or should. Always keep learning and if you do not like it, get out of it. Do what makes you happy! My main purpose is to help youth and also anyone for that matter learn they can make a good living in technology!