collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 508
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Moving Blocks Automatically every 3rd day?  (Read 5616 times)

0 Members and 1 Guest are viewing this topic.

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Moving Blocks Automatically every 3rd day?
« on: May 07, 2012, 09:49:57 PM »
I have 7 left block’s that are Custom HTML codes, they are all Ads with an Image that directs members to the Ads web site.

They all look like this

<html>
<body>
<a href="WEB SITE" target="_blank">
<center><img alt="THERE AD TITLE" title="THERE AD TITLE" src="AD IMAGE.jpg" width="120" height="70" /></center>
</body>
</html>

How can I move the last Ad to the top say every 3rd day automatically?
« Last Edit: May 08, 2012, 04:41:15 AM by Ozzy Mozzy »

Offline Sapinho®

  • Full Member
  • ***
  • Posts: 168
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Moving Blocks Automatically every 3rd day?
« Reply #1 on: May 09, 2012, 03:08:07 AM »
i think this not posible :(

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Moving Blocks Automatically every 3rd day?
« Reply #2 on: May 09, 2012, 04:20:58 AM »
thats a shame but ok....

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Moving Blocks Automatically every 3rd day?
« Reply #3 on: May 09, 2012, 10:21:37 AM »
I'm sure it could be done - rotating blocks in blocks. I can't help but maybe one of the coders will get round to it when time.

I did suggest something similar as a new feature in a future version - an advertising block system similar to those already for SMF. Problem is they do not work well with a portal as side blocks make extra, unnecessary columns. I guess if it is done it will be a custom block modification rather than a preset block.

But I've long given up expecting to tweak things 100% my way - would never have time to sleep, never mind anything else. Worst case is one of the SMF Ad mods but they work best in standard forum positions and top/bottom... not well in side columns. They will do random movement of Ads

Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Moving Blocks Automatically every 3rd day?
« Reply #4 on: May 09, 2012, 05:09:09 PM »
I do beleive that nothing is impossible...........

I think it would make a great addition to an already fantastic product. I only like Ads on the left so i'll stick with the way im doing it using Blocks and rotate them manually.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Moving Blocks Automatically every 3rd day?
« Reply #5 on: May 10, 2012, 08:53:41 AM »
1) In custom HTML blocks, you should not have the html or body tags.  Your page already has such tags, and each page should have exactly one set of html and body tags
2) What you want is not too difficult.  You will wind up writing a little bit of PHP.  Exactly how it goes depends on details. You could show a picture of your forum, and I would understand better. then I could tell you the basic idea of how to do it.  It will make a good first php project for you.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Moving Blocks Automatically every 3rd day?
« Reply #6 on: May 10, 2012, 08:58:10 AM »
Thanks for that...

it's the 7 left blocks.

www.largescaledownunder.com.au

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Moving Blocks Automatically every 3rd day?
« Reply #7 on: May 10, 2012, 12:46:20 PM »
Do you mean on http://www.largescaledownunder.com.au/index.php?action=forum

I don't see it on the portal page.

You need a php block for this.  The block would contain something like this, approximately.
I have not tested this.
Code: [Select]
$hs=array(
    array('title' => 'Symsteer', 'image' => 'http://largescaledownunder.com.au/banner/rokrc.png', 'link' => 'http://rokrc.com.au/shop/symsteer-symmetrical-steering-system'),
    array ('title' => 'King RC', 'image' => 'http://largescaledownunder.com.au/banner/King%20Logo%20web1.jpg', 'link' => 'http://www.kingrc.com.au/'),
);
$count = count($hs);
$rotate_frequency = 3; // number of days before you rotate the list

$day_of_year = getdate('yday');
$pd = floor($day_of_year/$rotate_frequency);

$start_with = mod($pd, $count) - 1; //  on day 1 through day 3, start with $hs[0]...


echo '<span style="font-weight: bold; text-align: center; color: rgb(92, 172, 238);" >Online Hobby Shops</span>
';


$order = array();

for ($i = $start_with; $i < $count, $i++)   $order[] = $i;
for ($i = 0; $i < $start_with; $i++) $order[] = $i;

foreach ($order as $i)
{
  echo '<br/>
',
         '<a href="', $hs[$i]['link'], '" target="_blank">',
          '<img width="120" height="70" title="', $hs[$i]['title'], '" alt="', $hs[$i]['title'], '" />',
          '</a>';
}




Edit: corrected line 3 of code -- added ' around string
« Last Edit: May 15, 2012, 07:42:08 AM by AngelinaBelle »
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Ozzy Mozzy

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Moving Blocks Automatically every 3rd day?
« Reply #8 on: May 10, 2012, 04:24:19 PM »
woops yes sorry your right its on the forum page.

ok copied and pasted that into a custom PHP block to test it and got this in the preview.

Parse error: syntax error, unexpected ':', expecting ')' in /home/steve71/public_html/Sources/PortalBlocks.php(3561) : eval()'d code on line 3

no idea what that means....lol

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Moving Blocks Automatically every 3rd day?
« Reply #9 on: May 14, 2012, 05:16:27 PM »
It means I made a mistake on line 3 (eval'd code on line 3).  I left out the quotation marks that must go around any string literal.  That's an example of a syntax error.

Sorry.
Code: [Select]
    array ('title' => 'King RC', 'image' => 'http://largescaledownunder.com.au/banner/King%20Logo%20web1.jpg', 'link' => 'http://www.kingrc.com.au/'),
These are only suggestions, of course. It will take some debugging on your part.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Moving Blocks Automatically every 3rd day?
« Reply #10 on: May 14, 2012, 11:12:57 PM »
I might use this as well ...   :)

Thanks.
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running