Recipe book admin alert - نوشته شده در (5534 Views)
Junior Member
thermal_seeker
مطلب: 430
430
I have been trying to get an admin alert working so that an admin knows when there is a new recipe to approve.
so far I have:

Code:
 '#######    Begin my code changes for Recipe Book     #######
if mlev = 3 then
Response.Write " <a href=""admin_recipe.asp?action=approve""" & dWStatus("Recipe To Approve...") & " tabindex=""-1""><acronym title=""Recipe To Approve..."">Recipe To Approve"
strSQL = "SELECT count(URL) FROM " & strTablePrefix & "RECIPE WHERE SHOW=0"
Set RScount = my_Conn.Execute(strSQL)
rcount1 = RScount(0)
RScount.Close
Set RScount = Nothing
if rcount1 > 0 then Response.Write "(<font color=""" & strActiveLinkColor & """><b>" & rcount1 & " New</b></font>) " & getCurrentIcon(strIconPMalert,"PM Alert","hspace=""0""")& vbNewline & _
" |" & vbNewline
end if

'####### End my code changes for Recipe Book #######

I think the part in red maybe the problem but just need a bit of help please

Dave
No good at coding, but I can plough a field !!
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Try this:
Code:

if mlev => 3 then
Response.Write "<a href=""admin_recipe.asp?action=approve""" & dWStatus("Recipe To Approve...") & " tabindex=""-1""><acronym title=""Recipe To Approve..."">Recipe To Approve"
strSQL = "SELECT COUNT(URL) FROM " & strTablePrefix & "RECIPE WHERE SHOW=0"
Set RScount = my_Conn.Execute(strSQL)
if not RScount.EOF then
rcount1 = RScount(0)
RScount.Close
end if
Set RScount = Nothing
if rcount1 > 0 then Response.Write "(<font color=""" & strActiveLinkColor & """><b>" & rcount1 & " New</b></font>) " & getCurrentIcon(strIconPMalert,"PM Alert","hspace=""0""")& vbNewline & _
" |" & vbNewline
end if
end if
نوشته شده در
Junior Member
thermal_seeker
مطلب: 430
430
Thanks Carefree, works like a charm.
No good at coding, but I can plough a field !!
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
You're welcome.
نوشته شده در
Senior Member
MaGraham
مطلب: 1297
1297
Ohhhh, I am Sooo glad I found this!

Now, could someone just tell me WHERE this code goes? tongue
"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Anywhere you want the link to appear. You can include it in "admin_home.asp" or "inc_header.asp", etc.
"admin_home.asp"

Code:

Look for the following line (appx 151):

if strArchiveState = "1" then Response.Write(" <LI><span class=""spnMessageText""><a href=""admin_forums.asp"">Archive Forum Topics</a></span></LI>" & vbNewLine)

Above it, insert the following:

strSQL = "SELECT COUNT(URL) FROM " & strTablePrefix & "RECIPE WHERE SHOW=0"
Set RScount = my_Conn.Execute(strSQL)
if not RScount.EOF then
rcount1 = RScount(0)
RScount.Close
end if
Set RScount = Nothing
Response.Write " <LI><span class=""spnMessageText""><a href=""admin_recipe.asp?action=approve"">Approve Recipes "
if rcount1 > 0 then
Response.Write "(<font color=""" & strActiveLinkColor & """><b>" & rcount1 & " New</b></font>) "
end if
Response.Write "</a></span></LI>"

"inc_header.asp"

Code:

Look for the following line (appx 495):

' DEM --> End of Code added to show subscriptions if they exist

above it, insert the following:

if mlev => 3 then
Response.Write " |" & vbNewline & _
"<a href=""admin_recipe.asp?action=approve""" & dWStatus("Recipe To Approve...") & " tabindex=""-1""><acronym title=""Recipe To Approve..."">Recipe To Approve"
strSQL = "SELECT COUNT(URL) FROM " & strTablePrefix & "RECIPE WHERE SHOW=0"
Set RScount = my_Conn.Execute(strSQL)
if not RScount.EOF then
rcount1 = RScount(0)
RScount.Close
end if
Set RScount = Nothing
if rcount1 > 0 then
Response.Write "(<font color=""" & strActiveLinkColor & """><b>" & rcount1 & " New</b></font>) "
end if
Response.Write "</acronym></a>" & vbNewline
end if
نوشته شده در
Senior Member
MaGraham
مطلب: 1297
1297
Thank you, Carefree!! You are always so quick to reply!
Thank you, again!! :)


"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Unfortunately, like the rest of the recipe book mod; it will not work on a MySQL database. The word "show" is restricted on MySQL and the database field must be renamed and all the software rewritten to reflect that change.
 
شما باید یک متن وارد کنید