Suddenly ALL dates of posts set to one date

User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Thank you for the detailed information! I will further testing over the next few days... And then Diego will be back. ;-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

DawidXT wrote: and here it everything got wiped out in blog section.
http://www.grepolis.onsteam.pl
Some more questions:
  • Are the names of the featured images still in the field "coverImage" of the database file posts.php (in /bl-content/databases)? Can you please give an example of an entry of a post in this file.
  • Are the featured images still on the server (in /bl-content/uploads)?
  • Do you use the function from Future Imperfect for the featured images?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
DawidXT
Sr. Bludit
Posts: 38
Joined: Wed Jul 15, 2015 3:56 pm

Edi wrote:Are the names of the featured images still in the field "coverImage" of the database file posts.php (in /bl-content/databases)? Can you please give an example of an entry of a post in this file.
Are the featured images still on the server (in /bl-content/uploads)?
Do you use the function from Future Imperfect for the featured images?
Edi,

ad1. I'm not sure what You mean, but I will show You how I made index.php along with post php template:

bl-themes / themename / index.php

Code: Select all

<!-- main content -->
				<?php
			        if( $Url->whereAmI()=='blog' ) {

                        echo '<div class="col-1">';
                                include(PATH_THEME_PHP.'post.php');
                        echo '</div>';
                        echo '<div class="col-2">';
                        include(PATH_THEME_PHP.'sidebar.php');
                        echo '</div>';
			        }
                    if( $Url->whereAmI()=='tag' ) {

                        echo '<div class="col-1">';
                            foreach($posts as $Post) {
                                include(PATH_THEME_PHP.'post.php');
                            }
                        echo '</div>';
                        echo '<div class="col-2">';
                        include(PATH_THEME_PHP.'sidebar.php');
                        echo '</div>';
			        }
                    elseif($Url->whereAmI()=='home') {
                        echo '<p>'.$Page->content().'</p>';

			        }
			        elseif($Url->whereAmI()=='post') {

                        echo '<div class="col-1">';
                            foreach($posts as $Post) {
                                include(PATH_THEME_PHP.'post-detail.php');
                            }
                        echo '</div>';
                        echo '<div class="col-2">';
                        include(PATH_THEME_PHP.'sidebar.php');
                        echo '</div>';

			        }
                    elseif($Url->whereAmI()=='page')
                     {
                        $template = PATH_THEME_PHP. $Page->slug(). '.php';
                        if(file_exists($template))
                           include_once($template);
                        else
                           include(PATH_THEME_PHP.'page.php');
                     }
			    ?>



and
bl-themes / themename / php / post.php (in my example this is the page where I list all my posts)

Code: Select all

<?php foreach ($posts as $Post): ?>

<!-- Plugins Post Begin -->
<?php Theme::plugins('postBegin') ?>

<!-- BLOG POST : START -->
<article>

	<div class="item-info">
		<?php
			// Get the user who created the post.
			$User = $Post->user();

			// Default author is the username.
			$author = $User->username();

			// If the user complete the first name or last name this will be the author.
				if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
					$author = $User->firstName().' '.$User->lastName();
				}
		?>
		<div class="user-avatar"><img src="<?php echo $User->profilePicture() ?>" alt="" /></div>
		<div class="author-date-info">
			<h2><?php echo $author ?></h2>
			<p>Dodano: <?php echo $Post->date() ?></p>
		</div>
	</div>
	<div class="cover-image">
		<div class="shadow-overlay"></div>
		<div class="cover-image-bg">
		<!-- Cover Image -->
		<?php
			if($Post->coverImage()) {
				echo '<a href="'.$Post->permalink().'" title="Czytaj cały artykuł"><img src="'.$Post->coverImage().'" alt="" /></a>';
			}
		?>
		</div>
	</div>
	<div class="mini-wrapper">
		<h1><a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a></h1>
		<div class="text-cut">
			<?php echo $Post->content() ?>
		</div>
		<a href="<?php echo $Post->permalink() ?>" title="Czytaj cały artykuł" class="read-more">(czytaj więcej...)</a>
	</div>

</article>
<!-- BLOG POST : END -->

<!-- Plugins Post End -->
<?php Theme::plugins('postEnd') ?>

<?php endforeach; ?>

<!-- Pagination -->
<div class="page-content">
   <ul class="pagination">
      <?php
         if( Paginator::get('showNewer') ) {
            echo '<li class="toleft"><a href="'.Paginator::urlPrevPage().'">Poprzednia strona</a></li>';
         }

         if( Paginator::get('showOlder') ) {
            echo '<li class="toright"><a href="'.Paginator::urlNextPage().'">Następna strona</a></li>';
         }
      ?>
   </ul>
</div>





and
bl-themes / themename / php / post-detail.php


Code: Select all

<!-- Plugins Post Begin -->
<?php Theme::plugins('postBegin') ?>

<!-- BLOG POST : START -->
<article class="full-width">

	<div class="item-info-big">
		<?php
			// Get the user who created the post.
			$User = $Post->user();

			// Default author is the username.
			$author = $User->username();

			// If the user complete the first name or last name this will be the author.
				if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
					$author = $User->firstName().' '.$User->lastName();
				}
		?>
		<div class="user-avatar"><img src="<?php echo $User->profilePicture() ?>" alt="" /></div>
		<div class="author-date-info">
			<h2><?php echo $author ?></h2>
			<p class="data-icon">Dodano: <?php echo $Post->date() ?></p>
			<ul class="tags-list">
				<?php
					$tags = $Post->tags(true);

					foreach($tags as $tagKey=>$tagName) {
						echo '<li><a href="'.HTML_PATH_ROOT.$Url->filters('tag').'/'.$tagKey.'">'.$tagName.'</a></li>';
					}
				?>
			</ul>
		</div>
	</div>
	<div class="cover-image-big">
		<div class="shadow-overlay-big"></div>
		<div class="cover-image-bg">
			<!-- Cover Image -->
			<?php
				if($Post->coverImage()) {
					echo '<img src="'.$Post->coverImage().'" alt="" />';
				}
			?>
		</div>
	</div>
	<div class="mini-wrapper-big">
		<h1><?php echo $Post->title() ?></h1>
		<div>
			<?php echo $Post->content(true) ?>
		</div>
	</div>

</article>
<!-- BLOG POST : END -->

<!-- Plugins Post End -->
<?php Theme::plugins('postEnd') ?>


ad2. Cover Images are still on server in the uploads location.
ad3. I was looking at future theme while I was making mine, so yeah, I could use some of its code in my theme.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

The following is an example of an entry in the database file post.php.

Code: Select all

{"eiffel-tower":
   {"description":"This is the description field.",
   "username":"admin",
   "status":"published",
   "tags":{"database":"database"},
   "allowComments":false,
   "date":"2016-03-26 13:46:44",
   "coverImage":"toureiffel1888.jpg",
   "checksum":"96f53e1c430fe569f324442e316e20d480758e45"
},
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

It seems that not all servers handle the new lines in JSON files in the same manner. It's an observation that could perhaps help... But at the moment I have no clue how this happens and if it really can corrupt a file.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
DawidXT
Sr. Bludit
Posts: 38
Joined: Wed Jul 15, 2015 3:56 pm

its ok Edi - You can't fix the world :)
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

DawidXT wrote:its ok Edi - You can't fix the world :)
But I try. Sometimes. :roll:
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
DawidXT
Sr. Bludit
Posts: 38
Joined: Wed Jul 15, 2015 3:56 pm

any news about Diego? how is he?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

DawidXT wrote:any news about Diego? how is he?
As far as I know he is fine and will be back next week. :-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

I set the memory limit to 8 MB, the execution time to 1 second, and the input vars to 500 (PHP 5.4). The website works without any problems... :roll:
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Locked