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] 2 3

Author Topic: 'Excluding' Directory  (Read 10377 times)

haelen

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 62
'Excluding' Directory
« on: December 02, 2006, 10:05:36 am »

Hi,

I have a Wordpress blog in a directory called (surprisingly) 'blog' - www.domain.com/blog

How can I prevent sNews from seeing that directory as 'within it's own structure' - if that makes sense.

IOW, how can I have a link to my blog in that directory without getting the sNews error: 'Content Not Found'

Thanks,
Tim
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
'Excluding' Directory
« Reply #1 on: December 02, 2006, 11:06:55 am »

Ok, the first I don' t really understand, the second one however... Linking to "external" pages, that is outside of sNews isn't that hard.

Take display pages in snews:
Quote
// DISPLAY PAGES
function pages() {
   $categorySEF = get_id('category');
   $pageSEF = get_id('article');
   $home = s('home_sef');
   $class = (empty($categorySEF) || $categorySEF == $home && empty($pageSEF)) ? ' class="current"' : '';
   echo '
  • '.l('home').'
  • ';
       $class = ($categorySEF == 'archive') ? ' class="current"' : '';
       echo '
  • '.l('archive').'
  • ';
       $query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 ORDER BY id";
       $result = mysql_query($query);
       while ($r = mysql_fetch_array($result)) {
          $class = ($pageSEF == $r['seftitle'])? ' class="current"' : '';
          if ($r['id'] != s('display_page')) {echo '
  • '.$r['title'].'
  • ';}
       }
       $class = ($categorySEF == 'contact') ? ' class="current"': '';
       echo '
  • '.l('contact').'
  • ';
       $class = ($categorySEF == 'sitemap') ? ' class="current"': '';
       echo '
  • '.l('sitemap').'
  • ';
    }
    And do this insertion:
    Quote
    // DISPLAY PAGES
    function pages() {
       $categorySEF = get_id('category');
       $pageSEF = get_id('article');
       $home = s('home_sef');
       $class = (empty($categorySEF) || $categorySEF == $home && empty($pageSEF)) ? ' class="current"' : '';
       echo '
  • '.l('home').'
  • ';
       $class = ($categorySEF == 'archive') ? ' class="current"' : '';
       echo '
  • '.l('archive').'
  • ';
       $query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 ORDER BY id";
       $result = mysql_query($query);
       while ($r = mysql_fetch_array($result)) {
          $class = ($pageSEF == $r['seftitle'])? ' class="current"' : '';
          if ($r['id'] != s('display_page')) {echo '
  • '.$r['title'].'
  • ';}
       }
    // Inserting external link:

       $class = ($categorySEF == 'SEF SOMETHING') ? ' class="current"': '';
       echo '
  • LINKNAME
  • ';

    // stop insertion


       $class = ($categorySEF == 'contact') ? ' class="current"': '';
       echo '
  • '.l('contact').'
  • ';
       $class = ($categorySEF == 'sitemap') ? ' class="current"': '';
       echo '
  • '.l('sitemap').'
  • ';
    }
    And you're set...
    Logged
    "It's only dead fish that goes with the flow... "
    Updated

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #2 on: December 02, 2006, 11:31:07 am »

    Hi Patric,

    Thanks for the quick response. (And the code!)


    Quote from: Patric
    Ok, the first I don' t really understand, the second one however... Linking to "external" pages, that is outside of sNews isn't that hard.
    OK. Quite simply put , I guess you'd call it an 'external directory' that needs to be reached.

    I'll try it now.

    Cheers,
    Tim
    Logged

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #3 on: December 02, 2006, 12:33:35 pm »

    OK, that *half* works (and thanks, BTW.)  What happens though is when I select any links within the Wordpress blog, they return to the sNews site rather than going to the links within Wordpress in the 'blog' directory.

    If you try it here, you'll see what I mean:

    http://www.timrowe.co.uk/

    Select the 'Blog' link and see what happens.

    Best,
    Tim
    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
    'Excluding' Directory
    « Reply #4 on: December 02, 2006, 12:54:46 pm »

    Mhm... soooo. We have made an external link from snews leading to the blog/wordpress thingy... (why do you even have that hiddious thing on there :lol:). First "target="_blank" do not validate... If you keep that in the link, your site won't pass... a sidenote.

    The only thing I see that is wrong is the links in wordpress thingy, I can't help you change it ads I don't know jackshit about it, but... Hover any link in wordpress eg the about link and you'll see that it looks like this:
    http://www.timrowe.co.uk/blog/?page_id=2

    Now this is where it goes wrong. The link should look like this:
    http://www.timrowe.co.uk/blog/index.php?page_id=2

    See that index.php before that first questionmark ? Try that link and you'll discover that you'll end up in the right place...

    Might possibly be a change in wordpress somewhere that needs to be made, I haven't got a clue, but atleast you know what the problem is now ;)... Perhaps .htaccess, possibly, maybe, like sort of... ;)... Let's see if anyone else have a solution shall we... ?

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

    brauck

    • Hero Member
    • *****
    • Karma: 18
    • Posts: 556
      • http://www.hbw-webdesign.nl/
    'Excluding' Directory
    « Reply #5 on: December 02, 2006, 01:03:52 pm »

    Hi Haelen,

    If I saw it  right , your sNews-installation is residing in the root of your htdocs.

    If so then you should give sNews its own folder e.g.:

    root
     +++ blog
                +++wordpress files and folders
     +++ snews
                snews files and folders

    What's happening with your site is problably a url-rewriting issue (see the .htaccess file)
    Logged
    Confidence is reduced complexity.
    brauck.nl for free css templates

    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
    'Excluding' Directory
    « Reply #6 on: December 02, 2006, 01:07:02 pm »

    Aha, .htaccess issue... I'm getting there ;). Sometime I'll even understand it. Oh, why then... We've got bram and other guy's here, why should I bother learning .htaccess :lol:
    Logged
    "It's only dead fish that goes with the flow... "
    Updated

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #7 on: December 02, 2006, 01:26:51 pm »

    Hi Patric

     <>

    Errrr, because I like it and don't have enough skill to create a blog within sNews?

    << First "target="_blank" do not validate... >>

    What's wrong with it?

    <http://www.timrowe.co.uk/blog/?page_id=2

    Now this is where it goes wrong. The link should look like this:
    http://www.timrowe.co.uk/blog/index.php?page_id=2

    See that index.php before that first questionmark ? Try that link and you'll discover that you'll end up in the right place...>>

    OK, I see what you mean.

    << Perhaps .htaccess, possibly, maybe, like sort of... ;)... Let's see if anyone else have a solution shall we... ?>>

    Brauck mentioned this, but I don't want to take my sNews installation away from the root directory

    Cheers,
    Tim
    Logged

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #8 on: December 02, 2006, 01:29:04 pm »

    Hoi Brauck,

    Thanks for your response.

    <>

    That's correct. Ideally I'd like to keep it there.


    >>What's happening with your site is problably a url-rewriting issue (see the .htaccess file)>>

    Yes. I'm not sure what (if anything) I'd need to edit there.

    Vast Bedankt!

    Tim
    Logged

    brauck

    • Hero Member
    • *****
    • Karma: 18
    • Posts: 556
      • http://www.hbw-webdesign.nl/
    'Excluding' Directory
    « Reply #9 on: December 02, 2006, 01:46:04 pm »

    Hi Tim,

    I answer in English, so that other people  can take note of it too  :)

    I don't think it's possible to keep your sNews installation in the root of your site in the way you want it. But I'm not an Apache expert. Probably bram will get to you, he's the man who knows all about it.

    I don't know the reason why you want your sNews install in the root; when you put it in its own folder you can redirect the visitors that come to your site with a simple .htaccess rule:

    Redirect  index.html http://www.yoursite/snews/index.php.

    Hope this helps :)
    Logged
    Confidence is reduced complexity.
    brauck.nl for free css templates

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #10 on: December 02, 2006, 02:01:11 pm »

    Quote from: brauck
    I answer in English, so that other people  can take note of it too
    That's OK. It's been years since I lived in Amsterdam and you Nederlanders speak such good English that I rarely had a chance to practice what little Dutch I spoke!  :)

    Quote from: brauck
    I don't know the reason why you want your sNews install in the root; when you put it in its own folder you can redirect the visitors that come to your site with a simple .htaccess rule:

    Redirect  index.html http://www.yoursite/snews/index.php.
    Eureka! I didn't realise there was such an elegant solution available.

    However, I'm getting a 404 error. Is this literally all I need to add to .htaccess :

    Redirect  index.html http://www.timrowe.co.uk/snews/index.php

    Thanks Brauck

    Best,
    Tim
    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
    'Excluding' Directory
    « Reply #11 on: December 02, 2006, 02:01:51 pm »

    Quote from: haelen
    << First "target="_blank" do not validate... >>
    What's wrong with it?
    Tim
    _blank simply doesn' validate... If you want to have a validated site according to http://validator.w3.org/ ...
    And now I was about to show you an error message due to that _blank, but I couldn't as your site wasn't there no more :lol:

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

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #12 on: December 02, 2006, 02:05:28 pm »

    Quote from: Patric
    Quote from: haelen
    << First "target="_blank" do not validate... >>
    What's wrong with it?
    Tim
    _blank simply doesn' validate... If you want to have a validated site according to http://validator.w3.org/ ...
    And now I was about to show you an error message due to that _blank, but I couldn't as your site wasn't there no more :lol:

    Patric.
    That's because I''ve changed directory as per Brauck's recommendation - but I'm still fiddling with it :)

    I didn't realise _blank was illegal, I've been using it for years to open a link in a new browser window / tab.

    Best,
    Tim
    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
    'Excluding' Directory
    « Reply #13 on: December 02, 2006, 02:17:54 pm »

    It's not ILLEGAL, it just don't validate... If you care about validation you should not use it, and if you don't...well please do...

    There are however validated solutions to obtain links being opened in new windows...Here's one:
    http://www.456bereastreet.com/archive/200610/opening_new_windows_with_javascript_version_12/

    I know Brauck's using something like this (check the tristar webdesign link here: http://www.brauck.nl/home/new_free_template/), and a few more, you could always search the forum for this, or PM some one about how they've solved it ;)

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

    haelen

    • Jr. Member
    • **
    • Karma: 0
    • Posts: 62
    'Excluding' Directory
    « Reply #14 on: December 02, 2006, 02:21:10 pm »

    Thanks for the links Patric - I'll check 'em out.

    Best,
    Tim
    Logged
    Pages: [1] 2 3