TinyPortal

Development => Support => Topic started by: jonash on December 08, 2008, 12:48:02 PM

Title: Default options in "Add article"
Post by: jonash on December 08, 2008, 12:48:02 PM
Hi,

I will hopefully create a bunch of articles, to make our website complete. Everytime I have created an article, I have to go to the option page and uncheck a lot of option. Is there a way to change these default settings somewhere?

I also found something about template pages, but didn't understand what it was... Is there some sort of doc somewhere? I just had a quick look about it in this forum so far...

Jonas
Title: Re: Default options in "Add article"
Post by: G6Cad on December 08, 2008, 12:52:26 PM
It's hard to point to any documentation when you forgot to add your info for us.

Please read the Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581)
Title: Re: Default options in "Add article"
Post by: jonash on December 08, 2008, 01:00:46 PM
Sorry, I forgot..

I run SMF 1.1.4 and TinyPortal v0.9.8 and BlueSkies.
Title: Re: Default options in "Add article"
Post by: G6Cad on December 08, 2008, 02:38:32 PM
Then the doc info is here
http://docs.tinyportal.co.uk/index.php?board=38.0;sort=subject
Title: Re: Default options in "Add article"
Post by: ed_m2 on December 08, 2008, 03:42:00 PM
I don't see what he's asking for in the documents G6.. a useful link though it is.

I'm transferring alot of articles at the moment, and also have a standard set of options I have to select every time. Some values are already set by default, not sure if this is hard coded or an updateable setting ?
Would be handy to have a 'set default article options' button or somesuch  that mean all subsequent new articles are created with those values.
Title: Re: Default options in "Add article"
Post by: IchBin on December 08, 2008, 03:51:05 PM
Don't know what you're asking about template pages jonash. As for the default options, in TP 1.x you can assign these to inherit their settings from the category. In the article you can check that option. There is no such option in TP 0.9.8.
Title: Re: Default options in "Add article"
Post by: ed_m2 on December 08, 2008, 04:07:04 PM
Quote from: IchBinâ,,¢ on December 08, 2008, 03:51:05 PM
Don't know what you're asking about template pages jonash. As for the default options, in TP 1.x you can assign these to inherit their settings from the category. In the article you can check that option.

Thats for display of the panels isnt it ?

I was thinking of stuff under the 'Details' heading:
Display date
Display title
Display all articles in same category
Display links to other categories
Display author
Display linktree
Display comments underneath article
Allow to comment?
Display top
Do not collapse comments initially
Display number of views
Display ratings
Allow to rate?
Title: Re: Default options in "Add article"
Post by: IchBin on December 08, 2008, 04:10:16 PM
Ah yes, no such option for that in TP 1.x either. Not sure whats planned.
Title: Re: Default options in "Add article"
Post by: insanemustang on December 08, 2008, 07:01:17 PM
Wouldn't that just be a simple edit to a file somewhere that changes a default value to be checked initially? 
Title: Re: Default options in "Add article"
Post by: IchBin on December 08, 2008, 08:02:18 PM
If its that simple, go ahead and give it a shot. lol
Title: Re: Default options in "Add article"
Post by: ed_m2 on December 08, 2008, 08:24:53 PM
Quote from: IchBinâ,,¢ on December 08, 2008, 08:02:18 PM
If its that simple, go ahead and give it a shot. lol

:D i did think that myself :D
Title: Re: Default options in "Add article"
Post by: jonash on December 08, 2008, 09:06:49 PM
Ok.. Maybe I need to clarify.  :-\ 
but ed_m's  post are the questions I tried to ask...

So I will have a look somewhere in the code...

Jonas
Title: Re: Default options in "Add article"
Post by: ed_m2 on December 08, 2008, 10:12:43 PM
Quote from: jonash on December 08, 2008, 09:06:49 PM
Ok.. Maybe I need to clarify.  :-\ 
but ed_m's  post are the questions I tried to ask...

So I will have a look somewhere in the code...

Jonas

if its hard coded in the article admin template you'd need to edit that.... just need some kind soul to confirm if that is the case and tell you what file that all happens in.

just a guess... maybe i have too much time on my hands  ;)
Title: Re: Default options in "Add article"
Post by: jonash on December 09, 2008, 12:46:46 PM
This is the code I found in smf/Themes/default/TPortalAdmin.template.php

// set options for an article...
                                $opts=array('','date','title','author','linktree','top','cblock','rblock','lblock','bblock','_tblock','category',
                                         'catlist','comments','commentallow','commentupshrink','views','rating','ratingallow');
     $tmp=explode(',',$mg['options']); $options=array();
      foreach($tmp as $tp => $val){
          $options[$val]=1;
      }
      $switch=0;
       for($i=1 ; $i<19 ; $i++){
            $switch++;
             if($switch==5){
                 $pad=8;
                $switch=0;
               }
                else
                     $pad=0;
              // for 1.0!!
              if($i!=9 && $i!=10)
                  echo '
                      <div style="padding-bottom: '.$pad.'px;">
                      <input style="vertical-align: middle;" name="tp_article_options_'.$opts[$i].'" type="checkbox"
value="'.$mg['id'].'" ' , isset($options[$opts[$i]]) ? 'checked' : '' , '> '.$txt['tp-articleoptions'.$i].'
                         </div>';
              }


I tried to change things there, but it did not work out so well.. If I changed something there, the saved articles get these values too, and not the saved..