Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 5

Author Topic: [MOD] 2 more Extra Functions for sNews 1.6.0  (Read 21285 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #15 on: September 10, 2007, 02:19:03 am »

Check to make sure the URL to your domain is correct as well as the other database settings in the configuration part of the engine file (at the top). Do you have the package installed in a sub-domain folder named "test" within the domain root (public_html) on your host server? Perhaps you should post the contents of your .htaccess file and your database settings here... with your real dbase uname and password not shown of course.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #16 on: September 24, 2007, 07:01:48 pm »

Hey Keys, I was just thinking.. Is there anyway to make the extra function like so
<php extra(extra_name); ?>

Since I was on the subject earlier for a different system, I remembered they had a function that works similar to the example I listed above.  This way multiple extras could be defined rather than adding second_extra, third extra, fourth_extra, etc...

I think currently it can be done with the default options  $idname=''.  idname could be the seftitle and could be defined as such in the template

Just an idea....
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #17 on: September 24, 2007, 11:07:23 pm »

An interesting thought / idea you're having there Equil (hmmm... sounds like a french name...)  ;D
I don't know how that approach would work. The sNews system is designed to use the one articles table for all of the content... whether it be a category, an article, and "extra" or a page. And each of these is assigned a hard-coded position ID number when it gets saved to the articles table... which enables us to query that data by calling on the ID number. This is the reason we have taken the approach of "cloning" an existing function... assigning a new position ID number... so that the content it generates can be distinguished from content generated by other functions... such as categories, pages and articles.

One way or another... each content type must use a unique position ID number. So... if you were to come up with another simpler way of assigning content position ID numbers for each content type... yeah... it might just work. But... then... there's no telling how deep you'll have to go in re-coding the whole sNews system to function in a different manner than it does now. You might be into creating a "fork"  8)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #18 on: September 25, 2007, 12:03:02 am »

Rewrite the core? Fork?

Why not something similar to:
$extraid = $r['seftitle'];

function extra($extraid) {

<?php extra(extra-article); ?>

Now I tried that and it doesn't work, but why can't it work?
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #19 on: September 25, 2007, 12:43:10 am »

weeellll... why not.
use seftitle as the key to access, and only draw from the db, those extra with that seftitle....

(seftitle is not entered by the user, but is still entered into the db)
extra($styleit = 0, $classname = '', $idname= '') <== need to add the var into here

yours probably didn't work, cos the first var is for styling... , so
extra($styleit = 0, $classname = '', $idname= '',$extra_new='')
would be called by
extra('','','','my_extra');(unless you want to add styling, in which case fill out other parameters)

you will need to alter the sql in extra function to ensure correct one is accessed.

however, this will only pull out a single item from the db, so you won't get a 'multi-extra' block as achieved by default version.

more thought and mod required.
Logged
Of all the things I have lost, it is my mind that I miss the most.

centered

  • Guest
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #20 on: September 25, 2007, 01:46:18 am »

Mod done... easy enough.. I hope

http://snewscms.com/forum/index.php?topic=5968
« Last Edit: September 25, 2007, 02:01:03 am by equilni »
Logged

Rob

  • Full Member
  • ***
  • Karma: 1
  • Posts: 219
    • http://www.ruthinweather.co.uk
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #21 on: November 15, 2007, 01:39:42 pm »

Has any tried using the extra functions on there own static page?

I have a client that needs to have the ability to update there food menu each week and this is to be housed on a seperate page, would extras work on another page apart from the index?
Logged
The road the righteous travel is like the sunrise, getting brighter and brighter until daylight has come.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #22 on: November 15, 2007, 03:32:43 pm »

You can have other PHP files in the site that use sNews functions. These files would be structured just like the sNews index.php file... in that they need to start with the same opening script at the top that includes the file in which the functions are contained... and the rest would be html with the sNews function-name strings added where required.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Rob

  • Full Member
  • ***
  • Karma: 1
  • Posts: 219
    • http://www.ruthinweather.co.uk
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #23 on: November 16, 2007, 10:24:24 pm »

Thought so, thanks for the reply keyrocks
Logged
The road the righteous travel is like the sunrise, getting brighter and brighter until daylight has come.

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
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #24 on: November 21, 2007, 10:32:21 am »

Hey, Key's this seems as the thing I need... Have it up and running now, but there seems to be one flaw... Have you discovered that or am I just doing it wrong.

I have set up two extras, and they're to show up on home/start... and home/start alone. In other pages I would like for other extras to show up.

Say I have created an "about" page, and one "services" and I've set up for the extras to show benieth the content in two divs. I would like the home to show one set of extra, and then the about being empty and the services show the second set of extras... You understand ? Am I using wrong MOD here... I thought this would do this, but I'm not being able to solve it... The first set is always overriding the second and shows up at the same time...

As in the "services" page, here I have the services dependant extra showing, and this is only showing here, but the first set is also showing...Mhm, want to get rid of it...

I think I've used some extra MOD this way before, but I'm not sure... Just pretty damn close to sure ;) But I can't find it it seems...

Thoughts ?


edit
Tried to create a new start page and assign the extra only to that, but then the extra won't show at all...

edit_2
Noticed that backlinks in ordinary articles when edited them leads to url.com/category//
« Last Edit: November 21, 2007, 10:57:08 am by Patric Ahlqvist »
Logged
"It's only dead fish that goes with the flow... "
Updated

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #25 on: November 21, 2007, 02:07:48 pm »

I need to do a bit more testing with the "extra" extras... once I finish a few other projects but... right now... in my MESU and MEMU projects... they do not display anything anywhere until I assign something to either the home or a category... then they display only on the pages of that category. When editing an extra, I can re-assign it to the home or any other category... and re-position it to center, a page, or any of the 3 extras.

The only problem I have experienced on my current test projects at this time... is that I have the second_extra and third_extra function-names wrapped with styled divisions in the index.php file... and the styled divisions are always visible on every page when empty. To have them invisible... the styled divisions cannot be used within index.php... so I need to confirm if moving them into the functions themselves will stop them from displaying until they have content published in them. This would be going against the grain of keeping all functions "template independent" but I don't yet see any other way to get around this one.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #26 on: November 21, 2007, 03:36:29 pm »

Styling of Extra Positions
sNews 1.6 comes with one "extra" content function. The "extra" function is the ONLY content type that allows you to pre-define its content container at the start of the function. I cannot find any posts or topics that actually describe this feature... but the details are outlined within Mika's DE version of the 1.6 snews.php file. I wasn't aware of this until looking in there this morning. Anyhow... we can style any extra function very easily using 3 variables in the first line of the function... to add and 'turn on' styling parameters.

Quote
function extra($styleit = 0, $classname = '', $idname= '')
[/quote]

Let's say we have three "extra" functions... as you would have after installing this mod:
- extra
- second_extra
- third_extra
Each of these functions can have differently styled containers, using division-class names for classes defined within the style.css file. As an example, we could have extra styled with a division class called .extra... and second_extra styled with a division class called .extra2... and the third_extra styled with a divisio classed called .extra3. So, we would turn on ($styleit by changing its parameter from "0" to "1". Then we insert the division-class name in between the single-quotes for $classname . So the starting lines for all 3 functions... using the example division-class names (used above) would be:

Quote
function extra($styleit = 1, $classname = 'extra', $idname= '')
function extra($styleit = 1, $classname = 'extra2', $idname= '')
function extra($styleit = 1, $classname = 'extra3', $idname= '')

... and each function will dispaly within its styled division when created and displayed. If using several different templates, you would use the same division-class in all templates... changing their parameters accordingly for each template.
« Last Edit: November 21, 2007, 03:40:47 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

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
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #27 on: November 22, 2007, 08:14:44 am »

I don't know if your answering me, Doug... But if you are the styling is not a problem to me... It's the presence of the default extra on every page... If I add a second_extra to a specific category, the default one is there aswell, and I would like to have one set of extra/second extra on the frontpage, and another one on a page, but I can't do that right now as the frontpage/home extra "overrides" the others...


I have discovered something else when testing this wonderful creation of yours, and that is that the rss is not working... Dunno what, I haven't gone deep into it, mearly discovered this fact when trying the MOD out...
« Last Edit: November 22, 2007, 08:18:31 am by Patric Ahlqvist »
Logged
"It's only dead fish that goes with the flow... "
Updated

Joost

  • Guest
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #28 on: November 22, 2007, 08:26:05 am »

Styling of Extra Positions
Yes, a very nice, but well hidden feature. Philmoz explains all about it in sNews 1.5.31 >> 1.6 changelog
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
Re: [MOD] 2 more Extra Functions for sNews 1.6.0
« Reply #29 on: November 22, 2007, 09:57:17 am »

Ok I think I'm crossposting here, hehe... Damn way for an admin to behave, eh ?

anyways more dilemmas here.

And to clearify (possibly) what I'm trying to achieve, what my original problem is... Lets start with what I've done:

I had a quite heavily modded version of 1.6 sNews. I tested Doug's 2 extra function MOD, and found it great, but implementing this onto my existing copy was to bigger deal for me, so I decided to go with DOM's additional article position MOD, which I presume is what this MOD of yours is somewhat based upon, Doug ?

So my heavily MOD'ed snews copy now has a second_extra function. Still the problems I can't figure out:

1. the linkback issue.
2. the dilemma I'm having trying to assign two extras (one default and one second) to different pages, which goes well. Problem arises when I want to add a set of extra to the frontpage... These two extras show up everywhere on mentioned pages aswell... I think that the extras, if used on categories only, would disappear as I want it... but I'm using pages...

Is there anyway of hiding HOME extras from other pages as they are hidden from HOME ?
« Last Edit: November 22, 2007, 10:16:19 am by Patric Ahlqvist »
Logged
"It's only dead fish that goes with the flow... "
Updated
Pages: 1 [2] 3 4 5