TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 515
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 603
  • Total: 603

Block Options

Started by Bytor, May 26, 2012, 05:08:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bytor

Link to my site: http://www.fauowlsnest.com/owlsnest
SMF version: SMF 2.0.2
TP version: TP V1.106
Default Forum Language: English
Browser Name and Version: Google Chrome 12.0.742.112


Description:

I am trying to display certain blocks on my articles pages only and not on the Frontpage. 

I noticed that the first option: Display on all pages and sections  and the second is for the block to be displayed Frontpage.

If I only check the first option, it will also appear on the frontpage. 

My question is, is there a way to have the first option not include the frontpage since, it is already one of the option available.  This would be very helpeful.

If not, is there a work around?


Thank you.

IchBin

That's why there's the option where you can select the articles(s) you want the block to show in down a little further in the selection options.

Bytor

That would work, but I need something more automated.

I created a page "Inside The Burrow" which post the latest article posted and do not want to have to edit the block option every time a new article gets posted. 

I tried to use custom actions, but because way I display the page uses ... /index.php?page='title of page' it overrides the custom action.  This way I am able to get all the functionality of each individual pages; view, rating, comments ...etc


Skhilled

I use a lot of blocks and articles but set the blocks to show articles within a category. This way any articles created with that category setting will automatically be put into that block...as long as they are approved. At least, that's how I do it. :)

Maxx1

I do the same as Doc, much easier and easier to change what comes up in a given block!

regards,
Maxx
But Mama, That's Where all the fun is!

Bytor

I tried using the Articles within a category, but it only list article titles.  I need the article page to show.

Much like www.yourforum.com/forum/index.php?page=page-title

Example of what I need the page to look like

I created a custom action called: tedHutton that will call this function, that will post the latest article posted.

Here is the function code:

<?php

if (!defined('SMF'))
die('Hack Attempt...');

function
TedHuttonMain()
{
$categories = array(5,46,47,52,53,54,56);

global
$scripturl, $db_prefix, $smcFunc, $page_title;

$request = $smcFunc['db_query']('', '
SELECT id, shortname
FROM {db_prefix}tp_articles
WHERE category IN ({array_int:cats})
ORDER BY date DESC
       LIMIT 1'
,
array('cats' => $categories)
       
);

while (
$row = $smcFunc['db_fetch_assoc']($request))
{

$page_title= $row['shortname'];

}

header('Location: http://fauowlsnest.com/owlsnest/index.php?page=' . $page_title );

}
?>


Skhilled

Ah! I see what you want but am not sure how to implement it. It would require custom coding but is beyond my knowledge.

Bytor

Quote from: Skhilled on May 27, 2012, 04:38:38 PM
Ah! I see what you want but am not sure how to implement it. It would require custom coding but is beyond my knowledge.

I've been trying to create a work around ... no luck so far on finding a solution  :(

One reason I did create a custom action was with the hopes that it would be an easy fix, but I guest when I use the re-direct, the custom action no longer applies ... tried to use that as part of the block display option.

Also, thought that if used the category option ( articles categories), that may be a another possible option, but that didn't work either.

Really stumped.  I was wondering if there was a way to possibly set a custom action globally before I run the function that displays the article page or if I there was a way to display certain block by author ID.



This website is proudly hosted on Crocweb Cloud Website Hosting.