Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2000
Posts: 159
Member
Member
Offline
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">";
}

Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
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
Offline
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
Offline
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>";

Sponsored Links
Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
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
Offline
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
Offline
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>";

Sponsored Links
Joined: Sep 2000
Posts: 159
Member
Member
Offline
Joined: Sep 2000
Posts: 159
Thanks so much!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)