<%@ Language="VBScript" %> <% 'On error resume next 'set conn = server.createobject ("adodb.connection") 'conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\domains\ghanagrio.com\db\dev_VideoghanaDB.mdb" 'set rsItemID = conn.Execute("SELECT * FROM video") 'set rsItem1ID = conn.Execute("SELECT * FROM video") 'set rsItem2ID = conn.Execute("SELECT * FROM hits") %> <% set conn = server.createobject ("adodb.connection") conn.Open "PROVIDER=SQLOLEDB;DATA SOURCE=174.36.247.115,1533; DATABASE=dev_VideoghanaDB;USER ID=gv-xtVideos$;PASSWORD=mzia123" set rsid = conn.Execute("SELECT Video.Presentlocation, Video.linkname, Video.itemId, Video.LinkLocation, Video.LinkDescription, Video.Sponsors, Video.Participant, Video.Link, Video.Display, Video.WhenAdded, CuReviewsVideo.id, CuReviewsVideo.product_id, CuReviewsVideo.Rating, CuReviewsVideo.Review_Description, CuReviewsVideo.Name, CuReviewsVideo.Review_Title, hits.movieid, hits.hit FROM CuReviewsVideo INNER JOIN video ON CuReviewsVideo.Product_ID = Video.ItemID Inner join Hits on Hits.movieid = Video.Itemid where CuReviewsVideo.display ='y' Order by CuReviewsVideo.ID DESC;") %> <% ' Constants from adovbs.inc, I wunt piss with these! :P Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = &H0001 ' constants, No of results per page Const PAGE_SIZE = 25 ' The size of our pages. Dim strURL ' The URL of this page so the form will work ' no matter what this file is named. Dim cnnSearch ' ADO connection Dim rstSearch ' ADO recordset Dim strDBPath ' path to our Access database (/database.mdb) file Dim strSQL ' The SQL Query we build on the fly Dim strSearch ' The text being looked for Dim iPageCurrent ' The page we're currently on Dim iPageCount ' Number of pages of records Dim iRecordCount ' Count of the records returned Dim I ' Standard looping variable Dim Conn ' Retreive the URL of this page from Server Variables strURL = Request.ServerVariables("URL") ' Retreive the term being searched for. I'm doing it on ' the QS since that allows people to bookmark results. ' You could just as easily have used the form collection. strSearch = "y" ' Retrieve page to show or default to the first If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If ' Since I'm doing this all in one page I need to see if anyone ' has searched for something. If they have we hit the DB. ' If not i just show the search form and quit. %> <% If strSearch <> "" Then ' MapPath of virtual database file path to a physical path. ' If you want you could hard code a physical path here. 'strDBPath = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\domains\ghanagrio.com\db\dev_VideoghanaDB.mdb" ' If you want you could hard code a physical path here. 'strDBPath = "c:\domains\ghanagrio.com\db\dev_VideoghanaDB.mdb" ' Create an ADO Connection to connect to the sample database. ' We're using OLE DB but you could just as easily use ODBC or a DSN. Set cnnSearch = Server.CreateObject("ADODB.Connection") ' This line is for the Access sample database: cnnSearch.Open "PROVIDER=SQLOLEDB;DATA SOURCE=174.36.247.115,1533; DATABASE=dev_VideoghanaDB;USER ID=gv-xtVideos$;PASSWORD=mzia123" 'cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";" ' We're actually using SQL Server so we use this line instead: ' cnnSearch.Open Application("SQLConnString") ' Build our query based on the input. ' If u have a clue what your doing u could change the way the results are ordered. strSQL = "SELECT Video.Presentlocation, Video.linkname, Video.itemId, Video.LinkLocation, Video.LinkDescription, Video.Sponsors, Video.Participant, Video.Link, Video.Display, Video.WhenAdded, CuReviewsVideo.id, CuReviewsVideo.product_id, CuReviewsVideo.Rating, CuReviewsVideo.Review_Description, CuReviewsVideo.Name, CuReviewsVideo.Review_Title, hits.movieid, hits.hit FROM CuReviewsVideo INNER JOIN video ON CuReviewsVideo.Product_ID = Video.ItemID Inner join Hits on Hits.movieid = Video.Itemid where CuReviewsVideo.display ='y' Order by CuReviewsVideo.ID DESC;" 'strSQL = "SELECT CuReviewsVideo.id, CuReviewsVideo.product_id, CuReviewsVideo.Rating, CuReviewsVideo.Review_Description, CuReviewsVideo.Name, CuReviewsVideo.Review_Title FROM CuReviewsVideo INNER JOIN video ON CuReviewsVideo.Product_ID = Video.ItemID where CuReviewsVideo.display ='y' Order by CuReviewsVideo.ID DESC;" 'set rsContentId = conn.Execute("SELECT * FROM xlaANMarticles INNER JOIN xlaANMiArticlesZones ON xlaANMarticles.ContentID = xlaANMiArticlesZone.ContentID WHERE xlaANMiArticlesZone.zONEID = 1;" ) ' Execute our query using the connection object. It automatically ' creates and returns a recordset which we store in our variable. Set rstSearch = Server.CreateObject("ADODB.Recordset") rstSearch.PageSize = PAGE_SIZE rstSearch.CacheSize = PAGE_SIZE ' Open our recordset rstSearch.Open strSQL, cnnSearch, adOpenStatic, adLockReadOnly, adCmdText ' Get a count of the number of records and pages ' for use in building the header and footer text. iRecordCount = rstSearch.RecordCount iPageCount = rstSearch.PageCount If iRecordCount = 0 Then ' Display no records error. %> <% Else ' Move to the page we need to show. rstSearch.AbsolutePage = iPageCurrent %> Ghana Movies Reviews | ghanagrio.com <% Server.Execute("/includes/header2.htm") %> <% Server.Execute("/video/videomenu.htm") %>
Movies Review
Today:<%= FormatDateTime(Date, 1) %>

 

<%= iRecordCount %> Reviews

  Displaying Page <%= iPageCurrent %> of <%= iPageCount %>
<% topic = rstSearch.Fields("name").Value 'topic = Replace(topic,Chr(1),"%20") 'topic = Replace(topic,Chr(37),"%20") 'topic = Replace(topic," ","%20") 'response.write topic %> <% Do While Not rstSearch.EOF And rstSearch.AbsolutePage = iPageCurrent %> <% rstSearch.MoveNext Loop %>
Review
Movie
Views
<% 'set rsItem1ID = conn.Execute("SELECT * FROM video WHERE itemID=" & rstSearch.Fields("product_id").Value ) 'set rsItem2ID = conn.Execute("SELECT * FROM hits where movieid="& "'" & rstSearch.Fields("product_id").Value & "'" ) %> ><%= rstSearch.Fields("Name").Value %>
<% kens = rstSearch.Fields("Review_Description").Value kens = Replace(kens,"FUCK","F**K") kens = Replace(kens,"fuck","f**k") kens = left(kens,150) %> <%=kens%> ">... more

<%'= rstSearch.Fields("Hit").Value %>

<% If iPageCurrent > 1 Then %> <<Prev <% End If For I = 1 To iPageCount If I = iPageCurrent Then %> <%= I %> <% Else %> <%= I %> <% End If Next 'I If iPageCurrent < iPageCount Then %> Next>> <% End If %>

 

<% End If ' Close our recordset and connection and dispose of the objects rstSearch.Close Set rstSearch = Nothing cnnSearch.Close Set cnnSearch = Nothing End If 'Set rsItem1ID = Nothing 'Set rsItem2ID = Nothing %>

 

 
<% Server.Execute("/includes/footer2.htm") %>