This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Adding code
#11

(24-Dec-2013, 05:35 PM)mariank Wrote:  Is there a way that instead of choosing Hide form and then letting everyone open it, instead can it be that if $cmtx_set_name_value is "" it just stays hidden without the option of opening it. And if $cmtx_set_name_value = a name it's not hidden?

That's what I meant originally. You need to open the form template (which I gave the path to) and wrap all of the code inside it so it's like this:

PHP Code:
<?php 
if ($cmtx_set_name_value) {
//all the form template code goes here
} else {
echo
'You must be logged in to post a comment.';
}

Have you completed the interview?
Reply
#12

Reply
#13

I moved the first line so it's in the middle between these two lines like this

PHP Code:
<?php global $cmtx_default_name, $cmtx_set_name_value; ?>
<?php
if ($cmtx_set_name_value) { ?>
<?php
if (isset($cmtx_set_name_value) && !empty($cmtx_set_name_value) && ...

The very end is the last thing in the entire file

PHP Code:
<?php } else {
echo
'You must be logged in to post a comment.';
}
?>

There's something wrong cause everything stops here (my footer which is below the whole comment link doesn't get accessed

FOUND A PROBLEM - The line <?php if ($cmtx_set_name_value) { ?> is inside a function so the {from the function name is shut off so I moved the line out. Now I moved it to the top where I first put it
the line Add Comment appears whether I'm logged in or not and that is all - doesnt continue to myfooter line in my file.

Then I thought - AHH - you mean the <FORM> so I put them right inside. Then I tried right outside. Same problem. It "thinks" it works but doesn't display anything.

Sorry this is so long. I've really spent hours and hours trying - I really need help

Where does it decide that if there's no loggedin name to use anonymous?
Maybe that will be a better place to do keep out of this (I don't even need the line about logging in. If it's before form.php, I can just not go to form.php
Thanks
Reply
#14

Try replacing your form template file with the one I have attached.

If you set a name value in your integration code ..

PHP Code:
<?php 
$cmtx_set_name_value
= 'John';
$cmtx_identifier = '1';
$cmtx_reference = 'Page One';
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line

.. the form will display as normal. If you don't set a name value or it's empty ..

PHP Code:
<?php 
$cmtx_set_name_value
= '';
$cmtx_identifier = '1';
$cmtx_reference = 'Page One';
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line

.. a message saying "You must be logged in to post a comment." will display instead of the form.


Attached Files
.php form.php Size: 39.56 KB  Downloads: 27

Have you completed the interview?
Reply
#15

Slight improvement to the code.


Attached Files
.php form.php Size: 39.6 KB  Downloads: 24

Have you completed the interview?
Reply
#16

Thank-you for sending me code - but it still doesn't work - But I have a solution (I just need a drop of code)

I finally added the line an echo before
PHP Code:
<?php 
echo $cmtx_set_name_value;
if (
$cmtx_set_name_value) {
and sure enough if $cmtx_set_name_value is blank it's set to anonymous so it's never actually blank which is why I've been trying and trying and getting nowhere.

I have no idea where that anonymous comes from (it's not layout->form->default, that's blank

All I need is the correct PHP code to write
If $cmtx_set_name_value == 'anonymous' $cmtx_set_name_value = ''


I hope that will be the solution

I've tried every combination - this doesn't work
PHP Code:
<?php 
if ($cmtx_set_name_value == "anonymous"){
$cmtx_set_name_value = ""}
Reply
#17

FIXED IT!! (needed a Wink

IT WORKS, IT WORKS!!

tHANK -YOU

I will send a donation cause I really appreciate your work on this program

thanks
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
06-Aug-2014, 08:43 PM
Last Post by ppiper
19-Oct-2011, 04:23 PM

Forum Jump:


Users browsing this thread: 8 Guest(s)