Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Last 10 Post
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Last 10 Post

 Post Reply Post Reply Page  12>
Author
gölge View Drop Down
Groupie
Groupie


Joined: 16 April 2005
Location: Turkey
Status: Offline
Points: 182
Post Options Post Options   Thanks (0) Thanks(0)   Quote gölge Quote  Post ReplyReply Direct Link To This Post Topic: Last 10 Post
    Posted: 14 June 2006 at 8:36pm
for not shown hidden posts add this code after WHERE at sql connection code :
 
Where tblTopic.Hide = 0 And bla bla bla....
Back to Top
mbd2 View Drop Down
Groupie
Groupie


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 124
Post Options Post Options   Thanks (0) Thanks(0)   Quote mbd2 Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2006 at 9:07pm
Thanks Golge for the tip,  but I need to hide it now so only moderators  and admin can see posting.  Any ideas. Wink
 
Dale
 
 
<%
'#########################################################################
'##
'## Display Newest Forum Posts with WebWizForums v8.x
'## Modified by Dale (mbd2) to work with v8.x
'## ogrinally designed by www.maddog-asp.com
'##
'## Just change the database connection in the strMembersModCon
'## variable.
'##
'## Then make sure the strLastestPostsModForumPath is the right path
'## to your forum.
'##
'## Mod from www.maddogs-asp.com
'## 
'## Writen by Drew Gauderman (aka MadDog)
'##
'#########################################################################
%>
<style type="text/css">
<!--
.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12; color: black;}
a {font-family: Verdana, Arial, Helvetica, sans-serif, Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: none;}
a:hover {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: underline;}
a:visited {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: none;}
a:visited:hover {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: underline;}
-->
</STYLE>
<table cellpadding="3" cellspacing="1" width="186" bgcolor="" border="0" class="text">
  <tr>
    <td bgcolor="" align="center" class="tableSubLedger" height="15">10
      Newest Posts</td>
 </tr>
 <tr>
    <td width="33%" align="center" class="tableRow" nowrap height="25">
      <%
Dim rsLastestPostsMod
Dim adoLastestPostsModCon
Dim strLastestPostsModCon
Dim strSQLLastsPostsMod
Dim strLastestPostsModTopicSubject
Dim strLastestPostsModForumPath
Dim intLastestPostsTotal

'The path to the forum
strLastestPostsModForumPath = " "

'How many new topics to show
intLastestPostsTotal = 10

'Database connection
'-----------------------------
'-----------------------------

'Default connection
strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("")

'Uncomment for a full phsyical path. Then change the path
'strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="

'Uncomment for a DSN connection
'strLastestPostsModCon = "DSN=DSN_NAME"

'-----------------------------
'-----------------------------

Set adoLastestPostsModCon = Server.CreateObject("ADODB.Connection")
adoLastestPostsModCon.Open strLastestPostsModCon

Set rsLastestPostsMod = Server.CreateObject("ADODB.Recordset")

strSQLLastsPostsMod = "SELECT Top " & intLastestPostsTotal & " tblTopic.Topic_ID, tblTopic.Subject, tblForum.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "Where tblTopic.Hide = 0 And ((tblForum.Password) Is Null) "
strSQLLastsPostsMod = strSQLLastsPostsMod & "ORDER BY tblTopic.Last_entry_date DESC;"

rsLastestPostsMod.Open strSQLLastsPostsMod, adoLastestPostsModCon

If rsLastestPostsMod.EOF Then
 Response.Write "<span class=""smltext"">No Forum Posts Made</span>"
Else
 Do while NOT rsLastestPostsMod.EOF
  If len(rsLastestPostsMod("Subject")) > 18 then
   strLastestPostsModTopicSubject = left(rsLastestPostsMod("Subject"),18) & "...&nbsp;"
  Else
   strLastestPostsModTopicSubject = rsLastestPostsMod("Subject")
  End If

  Response.Write("<a href=""" & strLastestPostsModForumPath & "forum_posts.asp?TID=" & rsLastestPostsMod("Topic_ID") & "&PN=1"">" & strLastestPostsModTopicSubject & "</a>")

 rsLastestPostsMod.MoveNext
 If NOT rsLastestPostsMod.EOF Then Response.Write("<br>")
 Loop
End If

'Reset Server Objects
rsLastestPostsMod.Close
Set rsLastestPostsMod = Nothing
adoLastestPostsModCon.Close
Set adoLastestPostsModCon = Nothing
%>
    </td>
 </tr>
</table>

Balloon Entertainment at it's best! www.mbd2.com -- Trade Show Presenter - video
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2006 at 11:03pm
change
strSQLLastsPostsMod = "SELECT Top " & intLastestPostsTotal & " tblTopic.Topic_ID, tblTopic.Subject, tblForum.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "Where tblTopic.Hide = 0 And ((tblForum.Password) Is Null) "
strSQLLastsPostsMod = strSQLLastsPostsMod & "ORDER BY tblTopic.Last_entry_date DESC;"



to

strSQLLastsPostsMod = "SELECT Top " & intLastestPostsTotal & " tblTopic.Topic_ID, tblTopic.Subject, tblForum.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & " WHERE tblForum.Password Is Null "
if not blnAdmin and not blnModerator then
strSQLLastsPostsMod = strSQLLastsPostsMod & "and tblTopic.Hide = 0 "
end if

strSQLLastsPostsMod = strSQLLastsPostsMod & "ORDER BY tblTopic.Last_entry_date DESC;"



the red part is what i changed


Edited by Scotty_32 - 14 June 2006 at 11:04pm
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
mbd2 View Drop Down
Groupie
Groupie


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 124
Post Options Post Options   Thanks (0) Thanks(0)   Quote mbd2 Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2006 at 3:00pm
Scotty_32
 
I've tried you solution and it doesn't work.  Users can still see posts that they should not (test and test2).  If they click on the title it tell them they don't have access, but they can still view the topic name.  Anybody else have any ideas?
 
 
Dale
 
 
Balloon Entertainment at it's best! www.mbd2.com -- Trade Show Presenter - video
Back to Top
gölge View Drop Down
Groupie
Groupie


Joined: 16 April 2005
Location: Turkey
Status: Offline
Points: 182
Post Options Post Options   Thanks (0) Thanks(0)   Quote gölge Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2006 at 3:41pm
it must be:
 
if intgroupid <>1 and intgroupid <>3 then
strSQLLastsPostsMod = strSQLLastsPostsMod & "and tblTopic.Hide = 0 "
end if
 
3 is moderator id. write your own moderator id for that...
Back to Top
mbd2 View Drop Down
Groupie
Groupie


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 124
Post Options Post Options   Thanks (0) Thanks(0)   Quote mbd2 Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2006 at 4:25pm
Nope, didn't work either.  This one has me really stumped.  I sure its an oversight, something staring us right in the face.
Balloon Entertainment at it's best! www.mbd2.com -- Trade Show Presenter - video
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2006 at 6:46pm
well my solution was so members dont see PENDING APPROVAL posts

i think maddog released his Last 10 posts for version 8 you can check that out
as that i beleive only shows posts users have permissions for, eg if you have a forum that only certain groups/members can enter

as the code above doesnt do this, it only hides topics that are in forums with passwords and topics that need approval by a moderator
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
benp View Drop Down
Newbie
Newbie
Avatar

Joined: 23 January 2003
Location: United Kingdom
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote benp Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2006 at 12:17pm
Has anyone tried this with MYSQL? I'm getting an error!!
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.