Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2]

Author Topic: sNews 1.4 code amendments and snippets  (Read 18059 times)

Rehuel Lobato de Mesquita

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 61
sNews 1.4 code amendments and snippets
« Reply #15 on: February 08, 2006, 04:18:55 PM »

no, this won't work

You have to create another table in your snews database, call it mail or something, with the fields id, from, email, link, body. (id should be primary, auto_increment)

Then your script should look like this:

Code: [Select]
$link = mysql_connect("localhost","root","passmyspam");

mysql_select_db("snews",$link);
$query="insert into mail (from, email, link, body) values ('".$Name."','".$Email."','".$Weblink."','".$Message."')";
mysql_query($query);

Then, for ease of use, you can make a separate html file to lookup your mail
Logged
Stretsh Out...

Procrastination is like masturbation. You do it till you figure out you're only screwing yourself!

Mario

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
sNews 1.4 code amendments and snippets
« Reply #16 on: February 08, 2006, 04:49:33 PM »

Quote from: albert

Now with the problem with people reading my file, what a bumer. So the best way would be to incert this into
the data base.

Maybe by writing the file to a subdirectory and protect that dir with .htaccess ?
Logged

Jochum Meester

  • Sr. Member
  • ****
  • Karma: 1
  • Posts: 309
    • JochumMeester.com
sNews 1.4 code amendments and snippets
« Reply #17 on: February 17, 2006, 10:51:39 PM »

Quote from: Stretsh
Code: [Select]
$mailbody = "To: ".$to."rn";
$mailbody .= "Subject: ".$subject."rn";
$mailbody .= "Header: ".$headers."rn";
$mailbody .= "Message: ".$message;
$filename = "Mail-from-".$to.".txt";
$fp = fopen($filename, "w");
if (!$fp) die ("cannot open the file");
fputs($fp, $mailbody, 4096);
fclose($fp);
?>
Where do I need to put the above?
And this?

Code: [Select]
$fp = fopen($filename, "a");
if (!$fp) die ("cannot open the file");
fputs($fp, $mailbody, 4096);
fclose($fp);
Logged

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
sNews 1.4 code amendments and snippets
« Reply #18 on: February 22, 2006, 07:30:45 PM »

hey guys..nice work on the code..but I really wanted to try and keep this thread clean so that we have a central repository for tested code and snippets ;)

it makes it so much easier for users to "find that piece of code that did this!"..instead of having to search through the forum or listings..which can be very frustrating as I'm sure you know. topic creep is just murder to keep track of  :'(

I will leave this thread as is for a week, and then attempt to clean and move the contents so we're back straight again ok..for the good of the users..thanks guys ;D
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
sNews 1.4 code amendments and snippets
« Reply #19 on: February 28, 2006, 07:32:43 AM »

As you're deleting "s*itty" posts bryn, I'm gonna answer this guy, ok.

I don't know WP at all...Do you want a styleswitcher or do you wanna show more templates ? For the first contact Albert, he's got a nice styleswitcher, för the second you just create new folders and upload snews files too, if you want different contentc on each instal, create a new set of tables with a prefix, and your set.

P
Logged
"It's only dead fish that goes with the flow... "
Updated

albert

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 405
    • http://www.oswt.co.uk/
sNews 1.4 code amendments and snippets
« Reply #20 on: February 28, 2006, 02:14:16 PM »

Hi

Wordpress?
Hang tight Wordpress designs will work, you just need to strip the code down.
 
As Wordpress has a lot of GPL designs will take a look soon :)

Albert
Logged
Albert
http://snews.awddesign.co.uk/snews/ site: v1.3
http://snews.awddesign.co.uk/           site: v1.2 http://www.awddesign.co.uk/
“Putting together the largest collection of sNews 1.5 designs. Coming very soon :)

albert

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 405
    • http://www.oswt.co.uk/
sNews 1.4 code amendments and snippets
« Reply #21 on: February 28, 2006, 02:40:40 PM »

If you put snews to a second level of any directory / root you will need to tell .htaccess

                                           |---- That is the second level
                                           |
http://WWW.MYSITE.com/snews/index.php

                                                       
Code: [Select]
main directory / root
|
|index.php
|
|
|  snews.php  -- version of v1.4
|
| .htaccess v1.4
|
|  rss.xml
|
|  readme.txt              
|                      
|-------/images  
|
|-------/img cmd 777
|
|-------/mods
|
|


#  .htaccess
#  sNews v1.4  16-feb-2006
#  Copyright(c) 2006, Solucija - All rights reserved

#  Uncomment following line if your webserver's URL
#  is not directly related to physival file paths.
#  Update Your Directory (just / for root)

RewriteBase /snews


Add this snipit to the sNews 1.4 readme.txt file by Albert :) It will help us All.

Albert
Logged
Albert
http://snews.awddesign.co.uk/snews/ site: v1.3
http://snews.awddesign.co.uk/           site: v1.2 http://www.awddesign.co.uk/
“Putting together the largest collection of sNews 1.5 designs. Coming very soon :)

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
sNews 1.4 code amendments and snippets
« Reply #22 on: February 28, 2006, 09:07:42 PM »

 ;D ;D ;D

ok..looks like my idea has fallen by the wayside..maybe a different method of thread ;)
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

paul

  • Newbie
  • *
  • Karma: 0
  • Posts: 6
sNews 1.4 code amendments and snippets
« Reply #23 on: May 01, 2006, 09:12:18 PM »

After tearing my hair out for a while, wondering why some forms work and some don't, I eventually found out the default search form doesn't terminate.

Anyway, the fix was simply to terminate the form tag in snews.php:

Line 923
Code: [Select]
// SEARCH FORM
function searchform() { ?>


 



Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
sNews 1.4 code amendments and snippets
« Reply #24 on: May 03, 2006, 08:56:49 AM »

well, it does kind of end:
Code: [Select]
   
with that trailing slash in it...But that do some things to other applications like JS insertions in some scripts wont work. So I have done the same ;)
Logged
"It's only dead fish that goes with the flow... "
Updated
Pages: 1 [2]