<%@include file="../includes/global.jspf"%> <% pg = 1; String code= getParameter(request,"code","none"); String category= getParameter(request,"category","realestate"); String size= getParameter(request,"size","120x60"); String format= getParameter(request,"format","gif"); String baseURL = "http://images.vflyer.com/banners/"+category+"/"+size+"/"; String directoryRoot = "C:/development/resin-3.0.7/webapps/vflyerlabs/images/banners"; String h = (String)request.getHeader("host"); if (!h.equals("localhost:8080")) directoryRoot = "/home/vflye3/public_html/images/banners"; String[] categories = getFileList (directoryRoot); String[] sizes = getFileList (directoryRoot + "/" + category); String[] images = getFileList (directoryRoot + "/" + category + "/" + size); title = "Affiliate Code Generator"; %> <%@include file="../includes/header.jsp"%>
vFlyer Labs » Affiliate Code Generator

Affiliate Ad Generator:
This page allows you to generate HTML to place affiliate ads on your site. Please note that you must first get an affiliate code from vFlyer to use this service.
Affiliate Code:
Category:
Size:
Format:


<% for (int i=0;i
<%=truncate(images[i],12)%>

GET HTML


<% } } %>
<%@include file="../includes/footer.jsp"%> <%! public static String [] getFileList (String path) { File file = new File(path); if (file.isDirectory()) { return file.list(); } return null; } public static boolean isImage(String name) { name = name.toLowerCase(); if (name.endsWith(".jpg")) return true; if (name.endsWith(".gif")) return true; if (name.endsWith(".png")) return true; return false; } public static boolean isImage(String name, String type) { name = name.toLowerCase(); type = type.toLowerCase(); if (name.endsWith(type)) return true; else return false; } public static int getWidth(String str) { StringTokenizer items = new StringTokenizer(str, "x"); int size = items.countTokens(); String[] result = new String[size]; for(int i = 0;i < size;i++) result[i] = (String)items.nextToken(); return (Integer.parseInt(result[0])); } public static int getHeight(String str) { StringTokenizer items = new StringTokenizer(str, "x"); int size = items.countTokens(); String[] result = new String[size]; for(int i = 0;i < size;i++) result[i] = (String)items.nextToken(); return (Integer.parseInt(result[1])); } public static String truncate(String str, int s) { if (str.length()>s) { str = str.substring(0,s)+"..."; } return str; } %>