41
ChadK
Re: MS-Weather LICENSE problem?
  • 2004/9/2 19:02

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


I would love to see Weather Harvest on Xoops! :)
I think that's the software I'd used for a short time before creating my own.. due to my fairly specific needs.



42
ChadK
Re: FreeContent Webdigest v.3.0 Final
  • 2004/9/2 16:49

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Is there a way to use the regex to filter lines that you WANT included?

on a page there are several entries like this:
<!-- 8291 misty mistyann5252@aol.com 08/10/04 -->
<
b>Ad No.: </b>8291 - <b>Subject: </b>trade Catalina macaw for sulphur Crested - <b>Posted on: </b>08/10/04<br>
<
b>Reply to: </b>misty at <a href="mailto: xxx">xxxx</a><br>
Catalina Macaw 12 months old ever sweet would like to trade for a Sulphur Crested cockatoo or a unbrella cockatoo or a african gray or sale for 1000.00 with cage <p>
<
a href="http://"></a><p><font size="-3">Your internet ID 
 | 
August 102004 at 12:53:47 
Mozilla/4.0 (compatibleMSIE 6.0AOL 9.0Windows NT 5.1)</font>
<
p><hr><p>
<!-- 
end 8291 -->


I want to grab everything from start to finish... but all I get is a bunch of useless links because these ads are text and don't contain links.



43
ChadK
Re: Web Hosting module
  • 2004/9/2 12:29

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Some things I'm still having trouble with on my site when creating default webspaces for users is:
The users name. If it has _ or punctuation etc, cpanel strips that information out when creating the account so the account login isn't identical. I'd like to force them to use more restrictive user names when registering to ensure it's compatible with CPanel.
The email address when creating an account is blank. I'd like it to populate with the address they registered with. I also need to add an email that sends them their login information and instructions on using their new site.



44
ChadK
Re: Web Hosting module
  • 2004/9/2 12:26

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Arowana:
to create an account in PHP using Cpanel's API:
//Create default web-space
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$host "localhost";
$user "your_WHM_account_name";
$accesshash "Your accesshash without any comments.";
//this is created on your WHM panel
$domain=$member['uname'].".aviary.info";
//for me, I am going to create a default space
//for every user when they validate their account
//on my site.
$username=$member['uname'];
//This also would be changed to suit your needs.
$pass=$member['pass'];
$plan="youraccount_free";
//the default plan for the user
//my _free plan is very very basic with only 
// a few features available.
$useSSH=0;
//set this to 1 if using this api call from 
//another domain/server
createacct ($host,$user,$accesshash,
$useSSH,$domain,$username,$pass,$plan);
//end default web-space



45
ChadK
Re: Web Hosting module
  • 2004/9/2 12:22

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


peterr: Yes that's why we're talking with the author of PHPCoin to get it integrated or made into a module. At the very least, to get permission to make a plug-in translator between the two systems that we can use for XOOPS and that they can offer as an add-on as well.

We can all read and don't really need your sarcasm.




46
ChadK
Re: MS-Weather LICENSE problem?
  • 2004/9/2 12:18

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


It's a copyright violation to use MS-Weather because it uses the data from Yahoo which they protect. It also uses the images downloaded from yahoo which is an obvious copyright issue.

I would suggest you not use MS Weather unless it's converted to use public domain information and it's own images.

I have a nice weather program that I wrote for an ASP CMS a while back.. I will most likely convert that for XOOPS because I also need weather and I need more functionality than is present in MS Weather.



47
ChadK
myAnnonces duplicate classified ad hack
  • 2004/9/2 11:55

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Sick of duplicate ads on your site?

Open myAds/addannonces.php and locate in the AddAnnoncesOK function:
$xoopsDB->queryF("INSERT INTO ".$xoopsDB->prefix("ann_annonces")." values ('', '$cat', '$title', '$type', '$description', '$tel', '$price', '$typeprix', '$date', '$email', '$submitter', '$usid',  '$town', '$country',  '$valid', '$filename', '0')");

... there's more but that's the line you're looking for.

Replace everything under that before the close of the function "}" with:
if($xoopsDB->getAffectedRows()<=0) {
        return 
False;
    } else {
        return 
True;
    }


Your function AddAnnoncesOK should look like this:
Quote:

function AddAnnoncesOk($lid, $cat, $title, $type, $description, $tel, $price, $typeprix, $date, $email, $submitter, $usid, $town, $country, $valid, $photo, $photo_size, $photo_name, $HTTP_POST_FILES) {
global $xoopsDB, $myts, $photomax, $xoopsConfig, $destination, $xoopsLogger;
include("cache/config.php");
include("include/functions.php");
$title = $myts->makeTboxData4Save($title);
$type = $myts->makeTboxData4Save($type);
$description = $myts->makeTboxData4Save($description);
$tel = $myts->makeTboxData4Save($tel);
$price = $myts->makeTboxData4Save($price);
$typeprix = $myts->makeTboxData4Save($typeprix);
$submitter = $myts->makeTboxData4Save($submitter);
$town = $myts->makeTboxData4Save($town);
$country = $myts->makeTboxData4Save($country);
$filename = '';
if ( !empty($HTTP_POST_FILES['photo']['name']) ) {
include_once(XOOPS_ROOT_PATH."/class/uploader.php");
$upload = new XoopsMediaUploader("images_ann/", array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/jpg', 'image/pjpg', 'image/x-png'), $photomax);
$upload->setTargetFileName($HTTP_POST_FILES['photo']['name']);
$upload->fetchMedia('photo');
if (!$upload->upload()) {
redirect_header("addannonces2.php?cid=$cat", 3, $upload->getErrors());
return False;
exit();
} else {
$filename = $upload->getSavedFileName();
}
}
$xoopsDB->queryF("INSERT INTO ".$xoopsDB->prefix("ann_annonces")." values ('', '$cat', '$title', '$type', '$description', '$tel', '$price', '$typeprix', '$date', '$email', '$submitter', '$usid', '$town', '$country', '$valid', '$filename', '0')");
if($xoopsDB->getAffectedRows()<=0) {
return False;
} else {
return True;
}
}



Now, in the same file, find the line
switch($op) {

In that section you'll see:
AddAnnoncesOk($lid$cid$title$type$description$tel$price$typeprix$date$email$submitter$usid$town$country$valid$photo$photo_size$photo_name$HTTP_POST_FILES)==True);

replace that line with this:
If(AddAnnoncesOk($lid$cid$title$type$description$tel$price$typeprix$date$email$submitter$usid$town$country$valid$photo$photo_size$photo_name$HTTP_POST_FILES)==True) {
    
redirect_header("index.php",1,_CLA_ANNADDED);        
} else {
    
redirect_header("addannonces2.php?cid=$cat",3,"Duplicate Classified. Not Added.");
}


You can make a variable for the language file if you want for the duplicate message but since my site is 100% English, my hack doesn't need that.. I just put the text I want right in the php.


You're not done.

You also need to create another index on your ..._ann_annonces table by running this sql statement:
ALTER TABLE `xoops_ann_annonces
ADD UNIQUE `PREVENTDUPE` ( `title` , `price` , `submitter` )

This adds a unique index on the combination of title, price and submitter. This will prevent the user from submitting the same title with the same price. Ever.
You can play around with your index to suit your needs by just changing the fields listed. If you change the fields and you've already added the index just use this sql to remove the index and rebuild it with your new fields:
ALTER TABLE `xoops_ann_annoncesDROP INDEX `PREVENTDUPE` ,
ADD UNIQUE `PREVENTDUPE` ( `title` , `price` , `submitter` )


Keep in mind that when you try to create the index you may get errors if there are already duplicate ads in your table. This is a pain in the ass of course so you'll need to go through and remove the duplicates as you find them. Keep running the sql statement until it finally goes through, meaning you have no duplicates. ;)

Then when a user submits an ad on your site it'll either go into the table or it will violate the index and fail. If it fails, it won't add the classified. ;)

Hope you find this as useful as I have.



48
ChadK
Re: Web Hosting module
  • 2004/8/31 18:57

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Predator: you're probably right.. that software is extensive. ;) But a stripped down API or something would be good.

Arowana: Yes, I'm basing the system off of recurring paypal payments/subscriptions.
I've learned how to integrate it with cpanel to actually create the accounts once they've paid for it and it's SUPER simple. ;)



49
ChadK
Re: MyAds - Last ads block
  • 2004/8/30 17:34

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Great.. yah that was one of the very first things I had to fix with the myAds software... also be sure you search for myAds and fix the other stuff that we've been working out over the last couple of months, namely the email problem. If you don't, your users will get the reminder email every time someone views the ads page. Could get annoying if you have a lot of users.



50
ChadK
Re: classifieds ads
  • 2004/8/30 17:20

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


simeon: that's not classified ad software.. it's banner software.




TopTop
« 1 2 3 4 (5) 6 7 8 ... 22 »



Login

Who's Online

236 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 236


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits