SimplePortal

Support => English Support => Topic started by: perfec2 on January 03, 2013, 05:34:15 AM

Title: I don't want my block duplicate my texts
Post by: perfec2 on January 03, 2013, 05:34:15 AM
I want to put html text that I will like to display in board index only not repeating in all pages in that board e.g in introduction board, I write description and don't want that same description to be repeated in next page etc but only in board index when clicked introduction board to avoid duplication of same text.
What would I put in "Custom Display Options"? 
Title: Re: I don't want my block duplicate my texts
Post by: TinMan on January 03, 2013, 10:49:15 AM
If you haven't already, have a look at this page and see if this maybe helps you out. -> Custom Blocks Display (http://simpleportal.net/index.php?action=docs;area=custom_blocks_display).

Are you wanting a block to show in the Introduction Board only and not any topics within that board?
If so, you could try something like...
~board|1.0,-~topic (change board number to your board)
This should allow it to show only in the board index but negate it from showing in any topics.
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on January 04, 2013, 01:40:55 PM
Thank for your help, I'm able to exclude from posts, what I'm looking in addition is to exclude it from the board's next pages, just to have it in the one board index only.
Title: Re: I don't want my block duplicate my texts
Post by: TinMan on January 04, 2013, 02:33:45 PM
Ahh ok...  I can't seem to block it from working on additional board pages either.
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on January 04, 2013, 02:50:04 PM
And Custom Blocks Display document doesn't appear to have the solution. Just thinking if there could be anyway round.
Because allowing same text to appear in all board isn't SEO wise. Still searching for solution....
Title: Re: I don't want my block duplicate my texts
Post by: AngelinaBelle on January 31, 2013, 09:17:23 AM
The easiest way to accomplish this is to put "forum" in the "Custom Actions".
This should work for standalone or frontpage portals.


Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 03, 2013, 03:18:18 PM
Put "forum" how, before or after the board? please can you write an example of how it will look like?
Title: Re: I don't want my block duplicate my texts
Post by: andy on February 04, 2013, 05:57:03 AM
Best to see the documentation section for this:

http://simpleportal.net/index.php?action=docs;area=block_editor


You can see advanced options and custom display details there in photos/text. Check the box for 'advanced options' in the display and it opens up new choices.
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 04, 2013, 08:51:18 AM
I'm familiar with the information in the link you provided, it doesn't solve the problem.
Title: Re: I don't want my block duplicate my texts
Post by: Chen Zhen on February 04, 2013, 10:29:32 AM

perfec2,

  Edit the block, enable the checkbox for Advanced Options, opt Select Boards, enable the checkbox(es) of the board(s) you want the block to appear on.

Admin -> Blocks -> YOUR SPECIFIC BLOCK -> Advanced Options -> Select Boards -> Opt Whichever Board(s)

After adjusting this setting, Opt to Edit Block (save).

Done.
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 04, 2013, 03:11:17 PM
The forum is using 1.x version of smf.
clicking on next page the description repeat itself and in post, but I'm able to get it off the posts made in the board not board pages. I don't want the description texts to duplicate but in only first page of the board.
Title: Re: I don't want my block duplicate my texts
Post by: Chen Zhen on February 04, 2013, 05:17:17 PM
perfec2,

  I am not understanding exactly what you are after here. From the link you provided, I see the list of posts has 9 pages & I do not see what is repeating from any Simple Portal block that you want omitted from all but page 1.
  Just to clarify.. this is regarding something showing in a SimplePortal block that you are attempting to omit while viewing any other page of topics with the exception of page1, correct?

 
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 05, 2013, 10:24:58 AM
I removed it because I didn't want it duplicating in all pages. However, I have just put it back in the footer with few texts for clarification sake. So you can see what I mean there.
Title: Re: I don't want my block duplicate my texts
Post by: Chen Zhen on February 05, 2013, 10:41:21 PM
perfec2,

  Imo what you are specifically after requires editing one SimplePortal file. Imo Sinan's negate does not work properly (as documented) in general especially when the url does not contain index.php?

  I wrote an edit for Eudemon a while back that would display a block on specific pages with a different command in the custom display options but I would have to write something specific to negate a block with the given data in that url using preg_match. 

  I'll take a look when I have some time although I can give you something quick right now that will work but only for a custom php block using no title & no body so as not to appear when beyond page 1.

Custom php block (no title & no body):
Code: [Select]
/* Current url */
function currentPagePosts($pageURL = 'http://')
{           
    if (!empty($_SERVER["HTTPS"]))
        $pageURL = "https://";   
   
    if ($_SERVER["SERVER_PORT"] != "80")
        $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    else
        $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
   
    return $pageURL;


$page = false;
$checkPage = explode('/', currentPagePosts());

foreach ($checkPage as $check)
{
if ($check == (int)$check && (int)$check != 0)
$page = true;
}

if (!$page)
{
/* Place your code below this comment line that you wish to display on page 1 only!! */



}

I will post a better solution when time permits..  :sleeping:
Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 06, 2013, 07:52:48 AM
Thank for your time, you have been helpful, however the Custom php block is displaying syntax error, I don't know if it has to do with smf version I'm using which is 1.x version of smf
Title: Re: I don't want my block duplicate my texts
Post by: Chen Zhen on February 06, 2013, 03:25:33 PM
Thank for your time, you have been helpful, however the Custom php block is displaying syntax error, I don't know if it has to do with smf version I'm using which is 1.x version of smf

perfec2,

  I am not receiving any syntax error nor any entries in the error log (tested on SMF 1.1.17). It appears to work clean for me.
Perhaps you added code to it that is causing the error.

Title: Re: I don't want my block duplicate my texts
Post by: perfec2 on February 07, 2013, 01:35:40 PM
Is from my end, I didn't put  echo "the text" , that is solved now as it gives me what I want.
Thank you all for the help.
SimplePortal 2.3.8 © 2008-2024, SimplePortal