Keyword

[SOLVED] Premium Content Items Invisible IF Not Logged In

More
7 years 11 months ago #161757 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there,

So I tried to move <!-- Item introtext --> before the line starting <!-- Item fulltext --> in the final code, but the page crashed, what am I supposed to be looking at including and where?

Here is a screenshot of my item.php at the moment with the final code in place - click for image link do I move the whole piece of code or add something inside it??

Thanks

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #161765 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
Can you put the code into a public gist ( at Github ) so I can take a look?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #161772 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there,

Public Gist link below with all code from my item.php file (in-case you needed it all) & the final code bit starts on line 230

gist.github.com/chrisvphogan/44ced725b3d45cc6ea19c8b303518e66

Many Thanks!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #161774 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #161810 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Perfect! That worked perfectly!! It's now it at the stage where I can crack on with adding content...

Thanks for all your help with this matter, although it was a lot more work than Joomla's one click 'Show Unauthorised Links' it has given me the advantage of working with K2 which will save be time in the future when added content/images/categories/videos etc :)

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 11 months ago #161861 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
You 're welcome :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago - 7 years 6 months ago #164625 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there,

I having having some issues trying to get my sites item.php to work again since updating to the new k2 and Joomla as well:

Below is the old code (you helped me compile in Github) but it doesn't seem to be working as it was in the item.php file.

Could you please advise on how to setup the old code in the new file, because as at present all my members area material is free if a user clicks on an articles image or the title.

Thanksyou!




My old code in the item.php
<?php if($this->item->params->get('itemIntroText')): ?>
		<!-- Item introtext -->
		<div class="itemIntroText">
			<?php echo $this->item->introtext; ?>
		</div>
		<?php endif; ?>

		<?php 
		if($this->item->params->get('itemFullText')): 
		$user = JFactory::getUser();
		if ($user->guest) {
			echo '<a href="https://ourdogsinternational.com/new/index.php/join-now">You must login to see the content!</a>';
		} else { 
			if(!empty($this->item->fulltext)): ?>

			<!-- Item Full text -->
			<div class="itemFullText">
				<?php echo $this->item->fulltext; ?>
			</div>

			<?php else: ?>
Last edit: 7 years 6 months ago by Chris Hogan.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #164631 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
Did you use overrides?
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

If not, you have to reapply the code (and override the file this time).

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #164633 by william white
Replied by william white on topic Premium Content Items Invisible IF Not Logged In
All i see is a missing } at the bottom which may be there and just not copied.
docs

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago - 7 years 6 months ago #164657 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Yes forgot to mention this code was in the overrides! I've looked at the github file again (line by line) and also tried to add just the changes into the newer updated v2.8 item.php file around the lines 220 among many other tests with no luck at all.

At present the page seems to show all the text (and in the same style as the first paragraph) mainly though it just no longer display the 'You must login to see the content!' after a snippet of intro text. goo.gl/houJ6S

Really not to sure why the exact same code or file no longer works!?
Last edit: 7 years 6 months ago by Chris Hogan.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #164666 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
Did you specify the full text in the item's editor?
If the full text is not specified (either with the read more button or by using two separate editors) the entire text is treated as the introtext.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #164669 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Yes all my news items have intro text setup in the K2 editor with a 'read more' button separator...

I believe its more of an issue with the links on news stories 'images' and 'titles' (in a category view) which is bypassing the normal page layout (and login procedure)

Because before the K2/Joomla update, the modified item.php (we worked on) would send users that clicked on a stories 'image' or 'title' directly to the stories page, BUT only the 'intro text' would appear with a similar 'register to login' link - which which was setup in the revised item.php

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #164697 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
Can you send me the entire item.php file through pastebin or github?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #164715 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there,

I've added to GitHub under the same subject title as this post:

gist.github.com/chrisvphogan/81a710f178c8cb075f75a0ff2c6f2769

Thanks!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #164724 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
gist.github.com/chrisvphogan/81a710f178c8cb075f75a0ff2c6f2769#file-item-php-L228

The check will only be performed if a fulltext is present. Can you remind me the URL of your site?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #164726 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi, the site url is www.ourdogsinternational.com

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #164831 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there, did you manage to check out the site?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 5 months ago #164891 by Krikor Boghossian
Replied by Krikor Boghossian on topic Premium Content Items Invisible IF Not Logged In
Can you enable (temporarily) the ?template= query string?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago - 7 years 1 month ago #166798 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Hi there,

I never actually managed to fix this issue; which was to get a guest to see the login message below IF THEY CLICK A ITEMS IMAGE OR THE TITLE OF THE ITEM.

Below is the code if you can have a look....as I'm not sure what the last post meant by " enable (temporarily) the ?template= query string? " But in the meantime could you tell me how to remove the link on a item image!
<?php if($this->item->params->get('itemIntroText')): ?>
		<!-- Item introtext -->
		<div class="itemIntroText">
			<?php echo $this->item->introtext; ?>
		</div>
		<?php endif; ?>

		<?php 
		if($this->item->params->get('itemFullText')): 
		$user = JFactory::getUser();
		if ($user->guest) {
			echo '<a href="https://ourdogsinternational.com/index.php/join-now">You must login to see the content!</a>';
		} else { 
			if(!empty($this->item->fulltext)): ?>

			<!-- Item Full text -->
			<div class="itemFullText">
				<?php echo $this->item->fulltext; ?>
			</div>

			<?php else: ?>

			<!-- Item text -->
			<div class="itemFullText">
				<?php echo $this->item->introtext; ?>
			</div>

			<?php endif; ?>
			
		<?php } ?>
		<?php endif; ?>

		<div class="clr"></div>
Last edit: 7 years 1 month ago by Chris Hogan.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #166846 by Chris Hogan
Replied by Chris Hogan on topic Premium Content Items Invisible IF Not Logged In
Any advice on how to remove the link on a item image is welcome please!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum