Results 1 to 2 of 2
  1. #1
    New Pligger agroads4's Avatar
    Joined
    May 2010
    Posts
    1
    Thanks
    Received:0
    Given: 0

    Automatically categorize the news

    (by Google Traductor)

    When you import news from different sources, we
    automatically categorize them? For example from a
    same news source that you should go to the category
    agriculture and other news from the same source dairy
    detection based on keywords in titles
    or descriptions of the news?

  2. #2
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,513
    Thanks
    Received:87
    Given: 14
    Site
    http://pligg.com/demo/
    This isn't the simplest solution, but it might work for you. Open up submit_step_2.tpl and find:
    Replace that with:
    Code:
            <select name="category">
                {if $url_short eq "http://www.collegehumor.com"}
                    <option value = "18">Humor
                    {section name=thecat loop=$submit_cat_array}
                      <option value = "{$submit_cat_array[thecat].auto_id}" {if  $submit_cat_array[thecat].auto_id ==  $submit_category}selected{/if}>                      {if $submit_cat_array[thecat].spacercount lt $submit_lastspacer}{$submit_cat_array[thecat].spacerdiff|repeat_count:''}{/if}
                              {if $submit_cat_array[thecat].spacercount gt $submit_lastspacer}{/if}
                              {$submit_cat_array[thecat].spacercount|repeat_count:'&nbsp;&nbsp;&nbsp;'}
                              {$submit_cat_array[thecat].name}
                              &nbsp;&nbsp;&nbsp;
                              {assign var=submit_lastspacer value=$submit_cat_array[thecat].spacercount}
                      </option>
                    {/section}
                {else}
                    <option value = "">{#PLIGG_Visual_Submit2_CatInstructSelect#}
                    {section name=thecat loop=$submit_cat_array}
                      <option value = "{$submit_cat_array[thecat].auto_id}" {if  $submit_cat_array[thecat].auto_id ==  $submit_category}selected{/if}>                      {if $submit_cat_array[thecat].spacercount lt $submit_lastspacer}{$submit_cat_array[thecat].spacerdiff|repeat_count:''}{/if}
                              {if $submit_cat_array[thecat].spacercount gt $submit_lastspacer}{/if}
                              {$submit_cat_array[thecat].spacercount|repeat_count:'&nbsp;&nbsp;&nbsp;'}
                              {$submit_cat_array[thecat].name}
                              &nbsp;&nbsp;&nbsp;
                              {assign var=submit_lastspacer value=$submit_cat_array[thecat].spacercount}
                      </option>
                    {/section}
                {/if}
            </select>
    Replace the domain with whatever domain you want to setup for this feature.
    Replace "Humor" with the category name.
    Replace "18" with the category ID. This can be found from Admin > Manage > Categories

    You can use || separators to specify multiple domains that qualify for the {if}. If you don't know what this means Google for Smarty code explanations or look for existing code snippets in the Pligg Wiki.
    Use {elseif $url_short eq "http://www.domain2.com"} to specify another category. That should go just before {else} in the example code above.

    Unfortunately this method will put the category name that you are auto-selecting at both the top of the drop down (pre-selected) and in it's normal spot. So from a usability standpoint this example code isn't clean or as simple as it should be. This is just the quickest example that I could come up with.

    If you want to hide the category selection altogether you can just wrap a <div style="display:none;"> CODE HERE </div> around it.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

Similar Threads

  1. is there a module/ way to automatically add news
    By delwizard in forum Questions & Comments
    Replies: 0
    Last Post: 01-11-2010, 10:45 AM
  2. How to make the upcoming news automatically published
    By philiscute in forum Questions & Comments
    Replies: 8
    Last Post: 09-06-2009, 10:09 PM
  3. Pligg 1.0.0: how to automatically published news?
    By skywalkerph in forum Questions & Comments
    Replies: 1
    Last Post: 07-25-2009, 01:39 AM
  4. [SOLVED] News (or items posted) are ever deleted automatically?
    By enzofsilva in forum Questions & Comments
    Replies: 2
    Last Post: 08-06-2007, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg