Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: 1 ... 3 4 [5] 6 7 ... 10
 41 
 on: August 12, 2014, 11:32:21 AM 
Started by sibas - Last post by sibas
Hello,
I have a php script where I want to add in to my site, (nothing to do with snews)

The scenario is
My site has already sNews and I want to add a new directory with this separate script
i.e http://www.mysnews/newscript/

This script has kind a strange setup (at least for me)

Directory of newscript has
Quote
folrder1
folder2
folder_public
httacces
config.php
NOTE -> NO index
Quote
in folder_public
has index.php
index exist in folder_public with this setup
Code: [Select]
<?php

define
('ROOT_PATH'realpath(__DIR__.'/..'));

spl_autoload_register(function($class)
{
    
$file ROOT_PATH.'/'.strtolower(str_replace('\\''/'$class).'.php');

    if(
is_file($file))
        require_once 
$file;
});

session_start();

require_once 
ROOT_PATH.'/config.php';

?>

htaccess exist in folder newscript and has the following
Code: [Select]
Options +FollowSymLinks

RewriteCond %{REQUEST_URI} !folder_public/
RewriteRule (.*) /folder_public/$1 [L]

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

Now the problem is I cant make it work, always return 404 not found in index of snews
my guess

define('ROOT_PATH', realpath(__DIR__.'/..'));
returns wrong path

Nomatter what i have try I can't make it work

any idea??

Note: script work perfect if i put it in root and not in subfolder  ???


 42 
 on: August 10, 2014, 05:30:26 PM 
Started by Edgardo - Last post by Keyrocks
Good to see it helped Ed.  ;)

 43 
 on: August 09, 2014, 06:35:33 AM 
Started by Edgardo - Last post by Edgardo
thenks key, as always you are very very very .... clear and my add clever with your answes. Have a good day

 44 
 on: August 08, 2014, 06:10:16 PM 
Started by Edgardo - Last post by Keyrocks
The [func] [/func] tag-set is for inserting the name of a PHP function within the content of an article or page, so that whatever the function does it will be displayed along with the content of the article or page. Of course, the PHP function needs to be in a PHP file that is already available ... such as the snews.php file in your sNews file-set.

Example One:
Let's say we create a PHP function to perform a specific task and we save the function somewhere within the snews.php file (so that it is enabled and available). For example, this function - nameit - will display the name defined as the value in its first string - $name = '<h2>My name is Edgardo</h2>'; (Edgardo in this example)  wherever the function is called.

Code: [Select]
<?php // ignore the PHP tag

function nameit() {
$name '<h2>My name is Edgardo</h2>';
return $name;
}
define('_MYNAME',nameit());

// ignore the php tag
?>


Next - to display your name within an article or page content, you would put the name of the function within the function-tags in the text-area like this - [func]nameit:|:[/func] - and wherever you put it, your name will be displayed in the <h2> font-size (since the name value is wrapped with <h2> HTML tags within the function itself).

Example Two:
Let's say you want to display a Contact form on a specific article or page. The PHP function that generates the Contact form is already in the snews.php file (by default) .... so you would just insert the function tag-set with the contact form function-name inside the tags like this - [func]contact:|:[/func] - and wherever you put it in the article or page text-area, the contact form will be displayed.

 45 
 on: August 07, 2014, 05:31:10 AM 
Started by Edgardo - Last post by Edgardo
Hi to all, been a long time.. but my mod was sleeping, I have made many changes on the mod before sleep that and worked fine, but my cuestion today is about the function button, the one [func][func] or some like that. Maybe you answer that but cud not find the answer. Is for php functions or may put javascript in there?
By the way one of my mods is to make searchs on comments too, by default just searchs on pages and it works fine, just one thing have to put paginator on 10, it was easy to think on that way, and left that way, maybe changing that harcoded number for the pagination variable should work. if anyone is intrested i will put the code. thenks

 46 
 on: August 06, 2014, 09:39:52 AM 
Started by Tropy - Last post by Tropy
The emoticons are there but if i look in public view they are only :laughing/: any answer?

 47 
 on: July 22, 2014, 03:11:42 PM 
Started by Tropy - Last post by Keyrocks
If you have TinyMCE's default Emoticons plugin installed and activated, check to make sure you have it initiated correctly:
Initializing - TinyMCE Emoticons Plugin

There is also a Smileys Plugin for TinyMCE that may be worth checking out - just be sure that it is compatible with whichever version of TinyMCE you are using: TinyMCE Smileys Plugin


 48 
 on: July 20, 2014, 03:41:50 PM 
Started by nukpana - Last post by nukpana
At the moment, based on this update from a few days ago (link), I am close to completing part B of this "outline" if you will call it that.

I noted here, that moving forward with a 1.x version can be done, it is hard to do.  If you want, this outline is a good start.  You will want to add updating or replacing out cleanXSS as it is getting a depreciated notice (at least for me):
Quote
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
Culprit:
Code: [Select]
            $source = preg_replace('/&#38;#(\d+);/me','chr(\\1)', $source);
            $source = preg_replace('/&#38;#x([a-f0-9]+);/mei','chr(0x\\1)', $source);

 49 
 on: July 19, 2014, 05:00:31 PM 
Started by Tropy - Last post by Tropy
the only thing at moment that didn't work is the smileys in tinymce in posted articles

if i want show a  ;D it shows LAUGHING:

how is the prob?

 50 
 on: July 19, 2014, 04:56:55 PM 
Started by Tropy - Last post by Tropy
sorry was my fault!

got something messed up in my code! :-X

Pages: 1 ... 3 4 [5] 6 7 ... 10