|
Joined: Sep 2000
Posts: 159
Member
|
Member
Joined: Sep 2000
Posts: 159 |
What I am looking for is code for how to make a New Topic in a Forum from the forum main page. There would be an arrow on the forum page like this, linking to newpost.php: [] http://www.roxydollboard.com/temporary/examplenewtopic.jpg[/] I was able to modify the ubbthreads.tmpl file to get the arrow to appear, but I would really appreciate it if someone can help me modify the ubbthreads.php file. I already tried this, but I need something more. I thank you in advance if you are able to help me! // --------------------------------------------------------------------- // We need to check and see if they have write privileges for this forum $gsize = sizeof($Grouparray); for ($i=0; $i <$gsize; $i++) { if (strstr($CanWrite,"-$Grouparray[$i]-") ) { $makepost = "yes"; break; } } if ($makepost == "yes") { $newpoststart = "<a href="{$config['phpurl']}/newpost.php?Cat=$Cat&Board=$Board&page=$page&view=$view&sb=$sb&o=$o">"; }
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
Addict
Joined: Dec 2000
Posts: 1,471 |
Your approach looks good. What isn't working as expected?
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
One of the tricks I use is to echo out the variables that I am using in the style sheet so I can see what they are. You might try adding something like Board = $Board and any other variable you want to look at. My guess is that one or more variables in the newreply.php link are either null or not what you need them to be...
|
|
|
|
Joined: Sep 2000
Posts: 159
Member
|
Member
Joined: Sep 2000
Posts: 159 |
I tried to add the code to the ubbthreads.php, with the goal being when I click on the notepad icon, it will take me to newpost.php. But when I click on the icon, nothing happens. I am missing something in the code for ubbthreads.php that will enable me to make the icon a hyperlink that takes me to newpost.php and I can figure it out. The hyperlink doesn't work at all. Where in the code would I put Board = $Board ? I think the problem is I got that code from postlist.php and newpost.php, where you are already IN the forum in which you want the new post to appear. I need guidance on how to specify the forum from the ubbthreads.php in the code. Thank you so much for your relies! Any help at all is greatly appreciated.
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
do the following
in ubbthreads.tmpl
find
{$forum[$c][$f]['lastposter']} - {$forum[$c][$f]['time']}
add below it
- {$forum[$c][$f]['newposttothisboard']}
and then in ubbthreads.php
find
$forum[$x][$y]['forumimage'] = ""; if ($forumimage) { $forum[$x][$y]['forumimage'] = "<td rowspan="3"><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&Board=$Keyword"><img src="$forumimage" alt="*" hspace="3" border="0" /></a></td>"; }
and below it add
$forum[$x][$y]['newposttothisboard'] = "<a href="{$config['phpurl']}/newpost.php?Cat=$Cat&Board=$Keyword"> <img src="{$config['images']}/edit.gif" border = "0" alt="*" /></a>";
|
|
|
|
Joined: Mar 2004
Posts: 118
Journeyman
|
Journeyman
Joined: Mar 2004
Posts: 118 |
Could someone attache a preview of this? Where does the icon show?
Also if user is anonymous and does not have write permissions to a specific board HOW NOT TO include the post image?
Kind regards, PaNTerSan
|
|
|
|
Joined: Sep 2000
Posts: 159
Member
|
Member
Joined: Sep 2000
Posts: 159 |
[] http://www.roxydollboard.com/temporary/examplenewtopic.jpg[/] The image shows just to the right of the date and time of the last entry. The advantage is now posters can make new topics in each forum right from the main page. Scroungr has made it so that if you do not have permissions to post in a forum, you will be taken to a page that says you do not have access. I know I gave thanks in private message, but I wanted to say again how much I appreciate this. You rock, Scroungr, and it works perfectly!
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
you can add code that basically states if $user['U_Number'] < 1 not to show the picture or link. You can also get creative and move this to the second cell where the Forum Subject is listed and make another for the last cell where this one is that will link to the addpost.php and will allow them to quickly reply to the subject that appears...
|
|
|
|
Joined: Sep 2000
Posts: 159
Member
|
Member
Joined: Sep 2000
Posts: 159 |
Could you indicate please what code you would use to link to the addpost.php so that it would link to reply to the subject that appears?
|
|
|
|
Joined: Oct 2003
Posts: 2,305
Old Hand
|
Old Hand
Joined: Oct 2003
Posts: 2,305 |
do the following
in ubbthreads.tmpl
find
{$forum[$c][$f]['lastposter']} - {$forum[$c][$f]['time']}
add below it
- {$forum[$c][$f]['newreplytothisthread']}
and then in ubbthreads.php
find
$forum[$x][$y]['forumimage'] = ""; if ($forumimage) { $forum[$x][$y]['forumimage'] = "<td rowspan="3"><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&Board=$Keyword"><img src="$forumimage" alt="*" hspace="3" border="0" /></a></td>"; }
and below it add
$forum[$x][$y]['newreplytothisthread'] = "<a href="{$config['phpurl']}/newreply.php?Cat=$Cat&Board=$Keyword&Number=$lastnumber"> <img src="{$config['images']}/edit.gif" border = "0" alt="*" /></a>";
|
|
|
|
Joined: Sep 2000
Posts: 159
Member
|
Member
Joined: Sep 2000
Posts: 159 |
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|