Important Notice: Effective immediately, all support will be handled through Discord. Read more about the changes coming to Anodyne's services.

Read Only User Access Role

A place to request Nova MODs. Note: all MOD requests are handled by third party developers, not Anodyne Productions.

Stormwolfe Sun Jun 17, 2012 4:23 pm

Read Only User Access Role

Good Day,

I thought I'd asked this question before, but could not find it via Search, so forgive me if I overlooked it. Also, that might actually need to go in General or Mod Request....not sure, so apologies if it's in the wrong place.

First, I am not a coder. I am trying to learn, but for now the words Seamless Substitution mystify me.

What I need, and this is actually a desperate need because not having it is affecting my site / game maintenance time HUGELY.

I need for ALL USERS to be able to VIEW but not EDIT ALL Posts - even saved ones they are not authors of. This is vital for them (and me) in order to see what character is where and more importantly when. I know I've been told that's what the timeline field is for, but we're a game that really really really needs to release each post in actual continuity sequence. Putting "Happens Before X" just does not work for us except in our casual, non mission specific posts.

Is there anyone out there willing to tackle adding this user role, creating a mod so they can have Read Only access to Saved Posts or something? If this is something that can be handled via the mysterious Seamless Substitution, anyone willing to give me Village Idiot instructions on how to do it?

Right now, I am spending a huge amount of time creating an e-mail several times a week with a direct link to each in-progress saved post so users can see what is where. The other option is that I have to answer a zillion inquiries from users on WHEN to date their post (i.e. what to put in their timeline field).

I know we're a small site and this is a very game specific request...but I am desperate...really really desperate.

Best Regards,

JC
User avatar

Posts: 467


AgentPhoenix Sun Jun 17, 2012 4:39 pm

Re: Read Only User Access Role

Moved to the right forum
User avatar

Posts: 7596


zshassun Mon Mar 17, 2014 9:33 am

Re: Read Only User Access Role

Hmm. Are you using Nova 1 or Nova 2? What I'd say is give everyone 'read saved posts' powers, and then dig into the Manage Post files in the core/modules and remove the 'edit'/'delete' code. If you *need* to edit a post (after it's been posted, if someone borks, etc), you can just hop back into those files and put the edit codes back, make the edits, then hop back in and remove them. That's what I do with my comments feed. It's a bit of a pain, but 90% of the time, there's little hassle.

I've included a bit of code here for you to modify.

In nova/modules/core/views/_base/main/pages/sim_viewpost.php, replace:

Code: Select all
<?php echo text_output($title, 'h1', 'page-head');?>

<p>
   <?php echo link_to_if(in_array(TRUE, $valid), 'manage/posts/edit/'. $post_id, $label['edit'], array('class' => 'edit fontSmall bold'));?>
</p>

<p class="fontSmall bold gray">
   <?php echo $label['posted'];?> <?php echo $date;?>
   <?php echo $label['by'];?> <?php echo $author;?>
   <?php if (isset($update)): ?>
      <br />
      <?php echo $label['edited'] .' '. $label['on'] .' '. $update;?><br />
   <?php endif;?>
</p>


with:

Code: Select all
<?php echo text_output($title, 'h1', 'page-head');?>

<p class="fontSmall bold gray">
   <?php echo $label['posted'];?> <?php echo $date;?>
   <?php echo $label['by'];?> <?php echo $author;?>
   <?php if (isset($update)): ?>
      <br />
      <?php echo $label['edited'] .' '. $label['on'] .' '. $update;?><br />
   <?php endif;?>
</p>


In nova/modules/core/views/_base/admin/pages/manage_posts_ajax.php, replace:

Code: Select all
<table class="table100 zebra">
      <tbody>
      <?php foreach ($entries as $e): ?>
         <tr>
            <td>
               <strong><?php echo $e['title'];?></strong><br />
               <span class="fontSmall gray">
                  <?php echo $label['by'] .' '. $e['author'];?><br />
                  
                  <strong><?php echo $label['mission'];?>:</strong> <?php echo $e['mission'];?><br />
                  <strong><?php echo $label['date'];?>:</strong> <?php echo $e['date'];?>
               </span>
            </td>
            <td class="col_150 align_right">
               <?php echo anchor('sim/viewpost/'. $e['id'], img($images['view']), array('class' => 'image'));?>
               &nbsp;
               <?php if ($e['status'] == 'pending'): ?>
                  <a href="#" rel="facebox" class="image" myAction="approve" myID="<?php echo $e['id'];?>" myPage="<?php echo $page;?>" myStatus="<?php echo $status;?>">
                     <?php echo img($images['approve']);?>
                  </a>
                  &nbsp;
               <?php endif;?>
               <a href="#" rel="facebox" class="image" myAction="delete" myID="<?php echo $e['id'];?>" myPage="<?php echo $page;?>" myStatus="<?php echo $status;?>">
                  <?php echo img($images['delete']);?>
               </a>
               &nbsp;
               <?php echo anchor('manage/posts/edit/'. $e['id'], img($images['edit']), array('class' => 'image'));?>
            </td>
         </tr>
      <?php endforeach;?>
      </tbody>
   </table><br />


with:

Code: Select all
   <table class="table100 zebra">
      <tbody>
      <?php foreach ($entries as $e): ?>
         <tr>
            <td>
               <strong><?php echo $e['title'];?></strong><br />
               <span class="fontSmall gray">
                  <?php echo $label['by'] .' '. $e['author'];?><br />
                  
                  <strong><?php echo $label['mission'];?>:</strong> <?php echo $e['mission'];?><br />
                  <strong><?php echo $label['date'];?>:</strong> <?php echo $e['date'];?>
               </span>
            </td>
            <td class="col_150 align_right">
               <?php echo anchor('sim/viewpost/'. $e['id'], img($images['view']), array('class' => 'image'));?>
               &nbsp;
               <?php if ($e['status'] == 'pending'): ?>
                  <a href="#" rel="facebox" class="image" myAction="" myID="<?php echo $e['id'];?>" myPage="<?php echo $page;?>" myStatus="<?php echo $status;?>">

                  </a>
                  &nbsp;
               <?php endif;?>
               <a href="#" rel="facebox" class="image" myAction="" myID="<?php echo $e['id'];?>" myPage="<?php echo $page;?>" myStatus="<?php echo $status;?>">

               </a>
               &nbsp;

            </td>
         </tr>
      <?php endforeach;?>
      </tbody>
   </table><br />


If editing issues arise where you need access to editing the post, just go back into each file and replace the first pieces of code.

Hope this helps!

Remember that because this is digging into core files, this change will NOT be saved when you update. Copy and paste a version of your original sim_viewpost.php file into wordpad before you start editing just in case you make any mistakes as well.
User avatar

Posts: 27


AgentPhoenix Mon Mar 17, 2014 10:10 am

Re: Read Only User Access Role

You should be using the _base_override folder in application/views to swap out the view files instead of modifying the core files.
User avatar

Posts: 7596



Return to MOD Requests

Who is online

Users browsing this forum: No registered users and 1 guest