Got a little techonology problem that you need fixed pronto? Post it here and we'll see what we can do.
Topic locked

Webmaster Freebies (Scripts: 3, Layouts: 0, Image-Packs: 1)

Sun Jun 13, 2004 4:57 pm

<img src="http://stoodder.50free.org/avatar.php">
Hola Guys! And Welcome Back To The PPT FORUMS WOOHOHO Sum 2004!... well thats not the point hehe lol

Im thinking to help a little what we ocudl do is make a topic where you guys posts your scrippts, free scripts of course, what ill do is take your scripts put them into a zip file and ill add them to this topic to download,m how does that sound?

if you guys are posting a script please try to include a sample,a nd maybe a short description if you can if you dont have one thats cool too so lets get this thing started.

Free PHP Scripts
=========================================

Webjunky News Script v 0.1A (View Demo)
(password is "MY_PASS" without quotes. It is also the default pass for the script.)
---Basically, this is just a VERY cheap news script. I will be adding many more features to it in the future. I wouldn't recommend actually using this script on a site yet but go ahead and download it so you can learn to make your own. Heck you can even change it so that it is a shout box!

Author: UncleKyKy | Date: Saturday, June 13, 2004 | Download


Free JavaScripts
=========================================

Test Script
my little test description
Author: Stoodder | Date: Today | Download

Free Layouts
=========================================

N/A
N/A
Author: Stoodder | Date: Today | N/A

Free Image-Packs
=========================================

Celtic Image Pack
---Have you ever wandered where Blizzard or other game site got those crazy squiggly backgrounds? well now you have a huge selection of borders, tile, background, images, and much more to choose form.
Demo:
Image
Author: Stoodder | Date: Tuesday, June 16, 2004 | Download
Last edited by stoodder on Mon Sep 06, 2004 5:50 am, edited 10 times in total.

Sun Jun 13, 2004 9:42 pm

I might as well...

You can download the Webjunky News Script v 0.1A at http://www.webjunky.us/download/wns_01A.zip .
A demo is available at http://www.webjunky.us/test/addnews.php (password is "MY_PASS" without quotes. It is also the default pass for the script.)
Basically, this is just a VERY cheap news script. I will be adding many more features to it in the future. I wouldn't recommend actually using this script on a site yet but go ahead and download it so you can learn to make your own. Heck you can even change it so that it is a shout box!

Coming to a monitor near you in the summer of 2004 will be the wjBB (maybe a different name). It is the Webjunky Bulletin Board. If i dont get lazy again. (progress can be viewed at http://www.webjunky.us/members/forum.php )

Wed Jun 16, 2004 3:54 pm

Caution: old code. It's been over 8 months since I wrote this -- and looking back, I can see a couple of bad ideas. But hey, it worked for me, and PPT used(uses) this.

This function generates the WHERE clause of a mysql-query, based on search terms, and search fields provided. The idea is quite simple.
Suppose you wanted to index every single page of your website by an internal search engine. Place the tagless contents of your content-files into a mysql table (suppose page_name, page_content as columns); create a PHP script (form) to get the search terms from the user, and then simply SELECT page_name FROM {your_index_table} WHERE {buildSearchQuery($user_inputed_terms,'page_content');}. This would give you the names of the pages that matched the query.
The script supports "search phrases" (quote two or more words to search for them appearing next to each other), NOT search terms (place a minus before the term), excluding common words, forcing inclusion of words (place a plus before the word).

In other words: fairly simple code.
Code:
<?php
function buildSearchQuery($terms, $fields) {
 $disallow = implode('|',explode(',','the,he,she,his,hers,it,will,has,been,where,how,when,if,had,can,may,could,not,and,why,because,no,am,is,was'));
 $terms = trim($terms);
 $sC = 0; //search element count
 while ($terms != '') {
  if (substr($terms,0,1) == '"' and substr_count($terms,'"') > 1) {
   $end = strpos($terms,'"',1);
   $element = substr($terms,0,$end);
   $terms = substr(strstr(substr($terms,1),'"'),1);
  } else {
   $end = strpos($terms,' ');
   if ($end === FALSE) $end = strlen($terms);
   $element = substr($terms,0,$end);
   if ($end == strlen($terms)) { $terms = ''; } else { $terms = substr($terms, $end); }
  }
  $element = trim(ereg_replace('(\?|!|\.)','',$element));
   
  $terms = trim($terms);
  if (strlen($element) == 1) {
   $stat['filter'] .= ', '.$element;
  } elseif (substr($element,0,1) == '-' or
                   substr($element,0,1) == '+' or
                  substr($element,0,1) == '"') {
    $seat[$sC] = str_replace('"','',$element);
   $sC += 1;
   } else {
    $insert = trim(ereg_replace(' ('.$disallow.') ','',' '.$element.' '));
    if (trim($insert) != '') {
    $seat[$sC] = $insert;
    $sC += 1;
    }
  }
 }
 
 for ($i=0;$i < $sC;$i++) {
  $not = '';
   $el = $seat[$i];
   $sChar = substr($el,0,1);
  if ($sChar == '-') {
   $not = 'NOT ';
   $el = substr($el,1);
  } elseif ($sChar == '+') {
    $el = substr($el,1);
   }
   $el = mysql_escape_string($el);
  $where .= " and ${not}(";
   foreach ($fields as $field) {
    $where .= ' '.$field." LIKE '%$el%' or";
   }
   $where = trim(substr($where,0,strlen($where)-2));
   $where .= ')';
 }
 $where = trim(substr($where,4));
 return $where;
}
?>

Wed Jun 16, 2004 4:00 pm

I got one. Its the date code.

Code:
<script language="JavaScript">

 
    days = new Array(7)
    days[1] = "Sunday";
    days[2] = "Monday";
    days[3] = "Tuesday";
    days[4] = "Wednesday";
    days[5] = "Thursday";
    days[6] = "Friday";
    days[7] = "Saturday";
    months = new Array(12)
    months[1] = "January";
    months[2] = "February";
    months[3] = "March";
    months[4] = "April";
    months[5] = "May";
    months[6] = "June";
    months[7] = "July";
    months[8] = "August";
    months[9] = "September";
    months[10] = "October";
    months[11] = "November";
    months[12] = "December";
    today = new Date(); day = days[today.getDay() + 1]
    month = months[today.getMonth() + 1]
    date = today.getDate()
    year=today.getYear();
if (year < 2000)
year = year + 1900;
    document.write ("<font size=2 face='verdana' color=000000> "+ day +
    ", " + month + " " + date + ", " + year + "</font>")
    // -- end hiding
    </script>

Wed Jul 07, 2004 11:43 pm

Seth's image shoutbox code:

Requirements:
PHP Version greater than 4.3
A MySQL database

Instructions:
Download the shoutbox package:
http://sethswebs.com/shoutbox.zip

First open up shoutbox.php and edit the following things:

Code:
$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";
$imurl = "ImageUrl goes here";
$x = "X position goes here";
$y = "Y position goes here";
$maxx = "The max width goes here";
$maxy = "The max height goes here";


$imurl is going to be the background image where the shouts will appear on.
X and Y are the text position, meaning the cordinates for that is where the text is going to start being written. Maxx is the maximum width that the text can go while Maxy is the maximum height the text can go.

Next in the same file find where it says

Code:
header("image/");


After the the image/ add the extension of the file you will be using(jpeg,gif,ect.). Note that jpg must be jpeg because that is the actual extension name.

Now find where it says

Code:
$im = @imagecreatefrom($imurl);


After the from in imagecreatefrom add the extension of the image you are going to use.

Now scroll down to where it says

Code:
$tc = imagecolorallocate($im,0,0,0);


If you want a color other than black then edit the three 0's to the colors you want for them. The 0's correspond to the RGB colors. If you want black then leave it alone. On the opposite side of the spectrum white would be 255,255,255.

Find where it says

Code:
return image($im);


After the image part add the extension of your image, so if you are using a png it should be:

Code:
return imagepng($im);


Now then open up shoutboxshout.php and shoutboxinstall.php and edit the code that says:

Code:
$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";


Next upload all the files then run shoutboxinstall.php in order to create your table for you shouts. When that is done you can delete it.

And if all goes well you have just created a shoutbox on an image, yay =^-^=.

Image

Note: This was inspired by a guy on Gaiaonline named Cremonte who first came up with the idea.
Topic locked