LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-29-2016, 04:10 PM   #1
nibraz
Member
 
Registered: Oct 2008
Posts: 219

Rep: Reputation: 18
MVC Blogs


Hi

Can someone point me in the right direction?

I have a blogs plugin for my php site but its in MVC. All my blogs are working fine but i dont know how i can insert google adsense into the middle of the contents "middle of blog post" so google ad will show.

This is the code from blogs/views/scipts/index/view.tpl

Code:
<h2>
  <?php echo $this->blog->getTitle() ?>
</h2>
<ul class='blogs_entrylist'>
  <li>
    <div class="blog_entrylist_entry_date">
      <?php echo $this->translate('Posted by');?> <?php echo $this->htmlLink($this->owner->getHref(), $this->owner->getTitle()) ?>
      <?php echo $this->timestamp($this->blog->creation_date) ?>
      <?php if( $this->category ): ?>
        -
        <?php echo $this->translate('Filed in') ?>
        <a href='javascript:void(0);' onclick='javascript:categoryAction(<?php echo $this->category->category_id?>);'><?php echo $this->translate($this->category->category_name) ?></a>
      <?php endif; ?>
      <?php if (count($this->blogTags )):?>
        -
        <?php foreach ($this->blogTags as $tag): ?>
          <a href='javascript:void(0);' onclick='javascript:tagAction(<?php echo $tag->getTag()->tag_id; ?>);'>#<?php echo $tag->getTag()->text?></a>&nbsp;
        <?php endforeach; ?>
      <?php endif; ?>
      -
      <?php echo $this->translate(array('%s view', '%s views', $this->blog->view_count), $this->locale()->toNumber($this->blog->view_count)) ?>
    </div>
    <div class="blog_entrylist_entry_body rich_content_body">
      <?php echo $this->blog->body ?>
    </div>
  </li>
</ul>


<script type="text/javascript">
  $$('.core_main_blog').getParent().addClass('active');
</script>
does anyone know how to insert google adsense into my posts?

thanks for helping
 
Old 06-30-2016, 07:07 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by nibraz View Post
Hi
Can someone point me in the right direction? I have a blogs plugin for my php site but its in MVC. All my blogs are working fine but i dont know how i can insert google adsense into the middle of the contents "middle of blog post" so google ad will show. This is the code from blogs/views/scipts/index/view.tpl
Code:
<h2>
  <?php echo $this->blog->getTitle() ?>
</h2>
<ul class='blogs_entrylist'>
  <li>
    <div class="blog_entrylist_entry_date">
      <?php echo $this->translate('Posted by');?> <?php echo $this->htmlLink($this->owner->getHref(), $this->owner->getTitle()) ?>
      <?php echo $this->timestamp($this->blog->creation_date) ?>
      <?php if( $this->category ): ?>
        -
        <?php echo $this->translate('Filed in') ?>
        <a href='javascript:void(0);' onclick='javascript:categoryAction(<?php echo $this->category->category_id?>);'><?php echo $this->translate($this->category->category_name) ?></a>
      <?php endif; ?>
      <?php if (count($this->blogTags )):?>
        -
        <?php foreach ($this->blogTags as $tag): ?>
          <a href='javascript:void(0);' onclick='javascript:tagAction(<?php echo $tag->getTag()->tag_id; ?>);'>#<?php echo $tag->getTag()->text?></a>&nbsp;
        <?php endforeach; ?>
      <?php endif; ?>
      -
      <?php echo $this->translate(array('%s view', '%s views', $this->blog->view_count), $this->locale()->toNumber($this->blog->view_count)) ?>
    </div>
    <div class="blog_entrylist_entry_body rich_content_body">
      <?php echo $this->blog->body ?>
    </div>
  </li>
</ul>


<script type="text/javascript">
  $$('.core_main_blog').getParent().addClass('active');
</script>
does anyone know how to insert google adsense into my posts?
Putting exactly "how to insert google adsense into my posts" into Google will give you lots...did you try that? Of the first few hits:
http://www.wpbeginner.com/wp-tutoria...-in-wordpress/
https://wordpress.org/support/topic/...-inside-a-post
 
Old 06-30-2016, 11:35 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
https://google.com/adsense/ maybe.

Just sayin'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MVC: Should event handling be in the controller component? rm_-rf_windows Programming 1 10-30-2012 01:56 AM
MVC MTK358 Programming 13 08-04-2010 10:22 AM
How should I use MVC meta pattern in Java viroos Programming 1 02-07-2009 06:20 AM
LXer: Spring MVC: Using Web view technologies LXer Syndicated Linux News 0 02-05-2007 08:33 PM
LXer: Struts, an open-source MVC implementation LXer Syndicated Linux News 0 09-02-2006 12:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration