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: 374
  • 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]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: BoardNews for Frontpage block  (Read 55234 times)

0 Members and 3 Guests are viewing this topic.

Offline radu81

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
    • www.sharkracingclub.it
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: BoardNews for Frontpage block
« Reply #20 on: July 03, 2013, 04:55:26 PM »
I'm also interested, pls share it ;)

Offline pugsx

  • Just Registered
  • Posts: 1
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #21 on: May 24, 2014, 10:36:18 AM »
Would like something like this.

sorry for reviving old post

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #22 on: November 12, 2014, 07:10:28 PM »
Yeah is this possible?

Offline langel

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #23 on: November 14, 2014, 02:01:07 AM »
Yes is posible, look my web: http://www.aplicacionesmart.com/index.php

Although it looks different, the principle is the same, only div & css

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #24 on: November 14, 2014, 07:07:34 AM »
Wow, would you be willing to share or help me out please?

my site is www.retrovideogamer.co.uk

Offline langel

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #25 on: November 14, 2014, 03:55:58 PM »
Yeah sure! look this thread: http://www.simplemachines.org/community/index.php?topic=337240.0

You can do so from SSI or the PortalBlocks.php, everything else is div and css.

Regards! :)

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #26 on: November 14, 2014, 05:09:15 PM »
I followed that and crashed the site, the English is broken so i am slightly worried i did it wrong.

Offline langel

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #27 on: November 14, 2014, 06:36:05 PM »
It is possible, although not very difficult to adapt to portalblocks.php

I recommend you do it there, and not in the SSI

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #28 on: November 14, 2014, 06:37:05 PM »
I am lost, could you do a guide please?

Offline zapiy

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
Re: BoardNews for Frontpage block
« Reply #29 on: December 22, 2014, 10:43:42 AM »
Anyone willing to help me out please?

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #30 on: December 25, 2014, 08:16:07 PM »
Hello guys,
I too have been looking for a way to do this for a long time and after going through the tutorial from http://destek.smfmod.com/haber-blogu-t18235.0.htm i was able to do it but i had issues, it did not turn out excitedly like this


This is how it turned out to be


Please i will appreciate any help on this.

Here is the code i used, for those that are interested in doing this on their site.
Locate your Sources/PortalBlocks.php

Find this
Code: [Select]
   if ($context['SPortal']['core_compat'])
   {
      foreach ($return as $news)
      {
         echo '
               <div class="tborder sp_article_content">
                  <table class="sp_block">
                     <tr class="catbg">
                        <td class="sp_middle">', $news['icon'], '</td>
                        <td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a></td>
                     </tr>
                     <tr class="windowbg">
                        <td class="sp_regular_padding" colspan="2">';

         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
            echo '
                           <a href="', $scripturl, '?action=profile;u=', $news['poster']['id'], '"><img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" style="float: right;" /></a>
                           <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
         else
            echo '
                           <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

         echo '
                           <div class="post"><hr />', $news['body'], '<br /><br /></div>
                        </td>
                     </tr>
                     <tr>
                        <td class="windowbg2" colspan="2">
                           <div class="sp_right sp_regular_padding">', $news['link'], ' ',  $news['new_comment'], '</div>
                        </td>
                     </tr>
                  </table>
               </div>';
      }
   }
   else
   {
      foreach ($return as $news)
      {
         echo '
               <div class="cat_bar">
                  <h3 class="catbg">
                     <span class="sp_float_left sp_article_icon">', $news['icon'], '</span><a href="', $news['href'], '" >', $news['subject'], '</a>
                  </h3>
               </div>
               <div class="windowbg sp_article_content">
                  <span class="topslice"><span></span></span>
                  <div class="sp_content_padding">';

         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
            echo '
                     <a href="', $scripturl, '?action=profile;u=', $news['poster']['id'], '"><img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" class="sp_float_right" /></a>
                     <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
         else
            echo '
                     <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

         echo '
                     <div class="post"><hr />', $news['body'], '</div>
                     <div class="sp_right">', $news['link'], ' ',  $news['new_comment'], '</div>
                  </div>
                  <span class="botslice"><span></span></span>
               </div>';
      }   
   }
   if (!empty($per_page))
      echo '
               <div class="sp_page_index">', $txt['sp-articlesPages'], ': ', $page_index, '</div>';
}

Replace with this
Code: [Select]
   if ($context['SPortal']['core_compat'])
   {
      foreach ($return as $news)
      {
         echo '
               <div class="tborder sp_article_content">
                  <table class="sp_block">
                     <tr class="catbg">
                        <td class="sp_middle">', $news['icon'], '</td>
                        <td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a></td>
                     </tr>
                     <tr class="roundframe">
                        <td class="sp_regular_padding" colspan="2">';

         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
            echo '
                           <a href="', $scripturl, '?action=profile;u=', $news['poster']['id'], '"><img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" height="30" style="float: right;" /></a><br />
                           <div class="middletext">', $news['time'], ' | ', $txt['by'], ' ', $news['poster']['link'], '</div>';
         else
            echo '
                           <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '</div>';

   
                  echo '               
                           <div class="post"><hr /><div class="haberblog">', $news['body'], '<br /><br /></div></div>
                        </td>
                     </tr>
                     <tr>
                        <td class="windowbg2" colspan="2"><hr />
                             <div class="yorumbuton">
                       <div class="yorum">', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div><div class="buton">', $news['link'], ' ',  $news['new_comment'], '</div></div>
                        </td>
                     </tr>
                  </table>
               </div>';
      }
   }
   else
   {
      foreach ($return as $news)
      {
         echo '
               <div class="cat_bar">
                  <h3 class="catbg">
                     <span class="sp_float_left sp_article_icon">', $news['icon'], '</span><a href="', $news['href'], '" >', $news['subject'], '</a>
                  </h3>
               </div>
               <div class="windowbg sp_article_content">
                  <span class="topslice"><span></span></span>
                  <div class="sp_content_padding">';

         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
            echo '
                     <a href="', $scripturl, '?action=profile;u=', $news['poster']['id'], '"><img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" height="30" class="sp_float_right" /></a><br />
                     <div class="middletext">', $news['time'], ' | ', $txt['by'], ' ', $news['poster']['link'], '</div>';
         else
            echo '
                     <div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '</div>';

         echo '
                     <div class="post"><hr /><div class="haberblog">', $news['body'], '</div></div><hr />
                       <div class="yorumbuton">
                       <div class="yorum">', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div><div class="buton">', $news['link'], ' ',  $news['new_comment'], '</div></div>
                  </div>
                  <span class="botslice"><span></span></span>
               </div>';
      }   
   }
   if (!empty($modSettings['articleperpage']) && !empty($context['page_index']))
      echo '
               <div class="sp_page_index">', $txt['sp-articlesPages'], ': ', $page_index, '</div>';
}

Then go to your portal.css and add this code below at the end of it
Code: [Select]
.haberblog {
   
   overflow: auto;
    margin-top: -16px;
}
.haberblog  img
{
   border: 1px solid #5998A7;
   border-radius: 3px;
   -moz-border-radius: 3px;
   margin: 16px 10px 0px 10px;
   -webkit-border-radius: 3px;
    padding: 6px 6px 6px 6px;
    width: 142px;
    height: 85px;
}
.haberblog  li a img
{

   border-radius: 3px;
    width: 142px;
    height: 85px;
}
.yorumbuton
{
   border: 0px solid #5998A7;
   width: 100%;

   overflow: auto;

}
.yorum
{
   border-right: 0px solid #5998A7;
   width: 50%;
   float: left;
    overflow: auto;
    padding: 5px 10px 10px 10px;
}
.buton
{
   border: 0px solid #5998A7;
float: right;
overflow: auto;

cursor: pointer;
padding: 5px 10px 10px 10px;
background: #f7f7f7;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#f7f7f7));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#f7f7f7',GradientType=0 );
border-radius: 5px;
}

Thats all. Please i need assistance in making it look the way it should.

Offline Infernus

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #31 on: December 26, 2014, 09:31:08 AM »
How does it look now then?

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #32 on: December 26, 2014, 02:27:36 PM »
How does it look now then?
It looks like this



Instead of Like this



I cant seem to figure out what the problem is, thats why i have come for help from all of you. I will be glad if any one can help.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: BoardNews for Frontpage block
« Reply #33 on: December 26, 2014, 04:12:28 PM »
You forgot an edit from the code you referenced and also it appears to be written for the SMF 1.1.X branch which is apparent from the second edit which you neglected to post.

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #34 on: December 26, 2014, 06:05:47 PM »
You forgot an edit from the code you referenced and also it appears to be written for the SMF 1.1.X branch which is apparent from the second edit which you neglected to post.
Please can you help out, the second edit was found in the fist edit, the one i posted above, that was why i neglected it, and it was also not found in the PortalBlocks.php
Please can i adapt it to work with my 2.0.9 thanks

Here is the 2nd edit code
find this
Code: [Select]
         echo '
                           <div class="post"><hr />', $news['body'], '<br /><br /></div>
                        </td>
                     </tr>
                     <tr>
                        <td class="windowbg2" colspan="2">
                           <div class="sp_right sp_regular_padding">', $news['link'], ' ',  $news['new_comment'], '</div>
                        </td>
                     </tr>
                  </table>
               </div>';
      }
   }

Change to
Code: [Select]
                  echo '               
                           <div class="post"><hr /><div class="haberblog">', $news['body'], '<br /><br /></div></div>
                        </td>
                     </tr>
                     <tr>
                        <td class="windowbg2" colspan="2"><hr />
                             <div class="yorumbuton">
                       <div class="yorum">', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div><div class="buton">', $news['link'], ' ',  $news['new_comment'], '</div></div>
                        </td>
                     </tr>
                  </table>
               </div>';
      }
   }

Offline Infernus

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #35 on: December 27, 2014, 02:30:31 AM »
Hoppe you like it, it's pure css. http://jsfiddle.net/17s1Ldjs/6/

Next improvement steps are:
  • Include the html code in PortalBlocks.php
  • Include css code in some css file (portal.css should be fine)
  • Load default image, if no image is found in topic.
  • Optimize/cache small images + avatars, instead of using huge ones. 

Further you could tweak it up even more, based on what you want it to be.
« Last Edit: December 27, 2014, 08:52:29 AM by Infernus »

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #36 on: December 27, 2014, 06:21:59 AM »
Hoppe you like it, it's pure css. http://jsfiddle.net/17s1Ldjs/6/

Next improvement steps are:
  • Include the html code in PortalBlocks.php
  • Include css code in some css file (portal.css should be fine)
  • Load default image, if no image is found in topic.
  • Optimize/cache small images + avatars, instead of using huge ones. 

Further you could tweak it up even more, based on what you want it to be.
Thank you for responding. I am lost please, how do i implement this, which section on the portalblocks.php am i to add include the html code. i dont understand how to go about this also
  • Load default image, if no image is found in topic.
  • Optimize/cache small images + avatars, instead of using huge ones. 

Offline Infernus

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #37 on: December 27, 2014, 08:51:14 AM »
You'll have to adapt HTML to PHP code. You showed us a working example above, now what you have to do is replace old HTML code with this one, so CSS rules matches.
Oh, and those steps are optional, I just thought they might be usefull.

Edit:
I think it's possible to create this as a custom block, so source code of portal won't be modified. (A giant block that contains other blocks  ;D, how awesome is that)
« Last Edit: December 27, 2014, 09:11:13 AM by Infernus »

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #38 on: December 27, 2014, 12:55:27 PM »
You'll have to adapt HTML to PHP code. You showed us a working example above, now what you have to do is replace old HTML code with this one, so CSS rules matches.
Oh, and those steps are optional, I just thought they might be usefull.
Ok thanks i will try and see if i will get it right,
Quote
Edit:
I think it's possible to create this as a custom block, so source code of portal won't be modified. (A giant block that contains other blocks  ;D, how awesome is that)
I would prefer to use custom block for it but my coding skill is little. if i can get the custom block code of it, i will appreciate.

Offline sub5

  • Semi Newbie
  • *
  • Posts: 25
    • All student forum
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: BoardNews for Frontpage block
« Reply #39 on: December 27, 2014, 06:59:13 PM »
I have been on it all day and i am not getting any where, i keeping getting error, there are link on you html code, which i dont understand why you are use those links, i was thinking the code will call up the news and the images just like the one in my first post.

Can you help out with a guide or custom block of the BoardNews for Frontpage?