| Author |
Message |
T0M
Joined: 23 Sep 2007 Posts: 11
|
|
|
|
 |  | Neh thats a global of SDK. SDK is a IPB integration tool.
I do not have a name field if people want to comment, they only have to type in their comment and the $member_name get's there name from the database when logged in. So al my forum members can also post on the website with their forum account and in that way members don't have to also sign up for a cutenews.ru account.
^^^ Crappy English, sorry about that, bit tired ^^^ |
I have been trying to do the same using PunBB and have had no luck yet, whenever i try to include a punbb variable into the comments template i get an error about whitespace.
I have tried to do this many ways, the recommended code from punbb is the following
 |  | <?php echo pun_htmlspecialchars($pun_user['username']); ?> |
Can anyone tell me where im going wrong with this?[/code]
|
|
| Sun Sep 23, 2007 2:06 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
T0M
Joined: 23 Sep 2007 Posts: 11
|
|
Please help |
|
Following on from my post above here is the exact error i get when trying to include
 |  | <?php echo pun_htmlspecialchars($pun_user['username']); ?> |
 |  |
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in |
After re-reading this thread i have tried to escape the variable as follows
 |  | <?php echo pun_htmlspecialchars(\$pun_user['username']); ?> |
which causes no output or errors
I have also tried alien13's mod of inc/show.news.php which hasn't helped me and have tried including the code without full php tags using <? ?> and without using php tags too.
Iam trying to include the php into the comments form template but being able to put it in any template would be a good start.
Below is an example of what iam trying to do (please excuse the tables and else echo statement)
 |  | <h2>Leave a comment</h2>
<?php if ($pun_user['is_guest'])
message("You must login to use leave a comment"); else echo [not-logged]
<input type="hidden" name="name2" tabindex="1" value="<?php echo pun_htmlspecialchars(\$pun_user['username']); ?>" />
[/not-logged]
</p>
</p>
<table width="500" border="0">
<tr>
<td><noindex>{smilies}</noindex> <br></td>
</tr>
<tr>
<td> <noindex>{bbcodes}</noindex></td>
</tr>
</table>
<p><textarea cols="100" rows="8" name="comments" tabindex="3"></textarea>
<br />
<input class="input" type="submit" tabindex="4" name="submit" value="Leave a comment" />
<br />
?>
|
|
|
| Tue Sep 25, 2007 3:43 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2736 Location: Germany |
|
|
|
Are you sure that the $pun_user variable is available on this page?
|
|
| Fri Sep 28, 2007 3:03 pm |
|
 |
T0M
Joined: 23 Sep 2007 Posts: 11
|
|
|
|
 |  | Are you sure that the $pun_user variable is available on this page? |
Thanks for taking the time to reply
Yes the variable is available on the page , i use it on every page including my cutenews homepage in the sidebar example below  |  | Welcome <?php echo pun_htmlspecialchars(\$pun_user['username']); ?> ! | so i don't see why it won't work. I have also made a test page and tried to output the variable more than once to see if this is the problem but its not that either 
|
|
| Sun Sep 30, 2007 3:45 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2736 Location: Germany |
|
|
|
If it's not working in the templates you still can use the variable in inc/show.news.php, can't you?
|
|
| Tue Oct 02, 2007 6:03 pm |
|
 |
T0M
Joined: 23 Sep 2007 Posts: 11
|
|
|
| Wed Oct 03, 2007 10:00 am |
|
 |
T0M
Joined: 23 Sep 2007 Posts: 11
|
|
|
|
Thanks for a point in the right direction FI-DD , has been something i have been trying to do for a long time.
Incase anyone else wanted to do this too i have posted instructions below.
Open inc/show.commentform.php
Find line 21
 |  | $output = str_replace('{password}', $member['password'], $output); |
After Add
 |  | $output = str_replace('{puname}', $pun_user['username'], $output); |
Now you can include the variable in the comments form by using {puname} dont forget to include common.php in you page also, the above code is for punbb intergration but can be edited for other forum scripts.
|
|
| Thu Oct 18, 2007 5:23 pm |
|
 |
SickQuilver
Joined: 12 Mar 2008 Posts: 15 Location: Amsterdam, The Netherlands |
|
|
|
I'm trying somthing like this:
<?PHP $cntitle = {title}; ?>
i want the title in a email form i include this form from a extern file: include form.php
but i want the title in the value option from the input form:
<input size="111" name="thesubject" tabindex="4" value="Reactie op: <?PHP echo"$cntitle" ?>" disabled>
but i'm not getting it to work.
is there a other way to include the title? is there a standard var?
|
|
| Mon Mar 31, 2008 8:38 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1843 Location: US |
|
|
|
I use <?=cn_title(); ?>
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Tue Apr 01, 2008 6:03 pm |
|
 |
snatch518
Joined: 07 Jun 2008 Posts: 8
|
|
I'm having trouble too... |
|
I'm running 2.5 and I want to include PHP in my templates so I can display the 10 latest articles from the articles page... does anyone know what to do yet?
|
|
| Sat Jun 07, 2008 4:24 pm |
|
 |
Goberg
Joined: 18 Jan 2007 Posts: 43
|
|
Re: I'm having trouble too... |
|
 |  | I'm running 2.5 and I want to include PHP in my templates so I can display the 10 latest articles from the articles page... does anyone know what to do yet? |
same problem here, im trying to show the last 5 news from all categories at the end of the full story. here is the code im using to include the news:
 |  | <?PHP
\$static['number'] = "5";
\$static['template'] = "flerenyheter";
\$PHP_SELF = "news.php";
include $cutepath.'/show_news.php';
?> |
|
|
| Mon Jun 09, 2008 3:34 am |
|
 |
Mystic2010
Joined: 10 Jan 2007 Posts: 50
|
|
|
|
May not be the solution, but I noticed you didn't escape the $cutepath. $cutepath -> \$cutepath
|
|
| Mon Jun 09, 2008 12:40 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2736 Location: Germany |
|
|
|
There's no need to do this using this plugin. Check the readme to learn how to show articles below the full story.
|
|
| Tue Jun 10, 2008 6:45 pm |
|
 |
fmanfredi
Joined: 22 Aug 2007 Posts: 9
|
|
|
|
worked perfect to my... thank you very much!! 
|
|
| Wed Jun 11, 2008 6:16 pm |
|
 |
snatch518
Joined: 07 Jun 2008 Posts: 8
|
|
php |
|
Is this only for 1.2? I'm using 2.5 and want to include PHP and the installation readme doesn't match the code I have.
|
|
| Wed Jun 11, 2008 11:52 pm |
|
 |
|