View Full Version : Tip of the day! hack
mjames
09-02-2001, 02:58 AM
How would this be related to vBulletin?
tubedogg
09-02-2001, 06:55 AM
Does it matter?
vBulletin can be formed into many things, including a site front-end (portal), CMS, site back-end, etc. etc. etc.
That said, I can also see this being used internally in vB for teaching users about the intracacies of vB.
Good ideas tubedogg :)
i myself would use it for the front page in a portal or the vB index.
More thoughts?
This could help
http://www.mattkruse.com/scripts/tip/index.html
but i prefer to see something using a database.
Admin
09-03-2001, 11:57 AM
I might start working on this.
Admin
09-03-2001, 01:09 PM
By the way, do you want it to be a single tip per day (like the thread title says), or a different tip every time the page is loaded (like that script you showed us)?
I think a random tip every time is better, but it's your hack...
Also, how do you want it to be formatted?
I think a link in the footer could pop up a page, with a random tip would be great.
Tell me what you think. :)
Cool :)
i made a rough screen shot of the hack to help you ...
you may change it to whatever you find easier for you
about viewing it to the members:
link with a pop up window would be nice
also, to integrate it in the page itself in a table.
hope this help :p
and thanks in advance :)
cheers,
FireFly, any updates on this?
Thomas P
09-09-2001, 06:47 AM
Hi,
good idea, Afterburner did this for UltraBoard and it was like in Windows Tip of the day. Was very stylish as it looked pretty the same as the tip of the day on windows machines.
We may contact him about that if he wants to share his coding he did so far.
cu,
-Tom
Afterburner
09-09-2001, 06:55 AM
no this were only hardcoded links and the newest topic off all. At the moment I dont have any interest to do anything - private problems -
Admin
09-09-2001, 08:10 AM
[QUOTE]Originally posted by Ruth
FireFly, any updates on this?
how is the work going FireFly?
The Prohacker
09-17-2001, 11:07 PM
If your still doing this, I just remembered about this cool setup for a tip of the day...
http://www.dynamicdrive.com/dynamicindex11/tod/tod.htm
If you did use this, you might have it set a cookie that will expire in 24 hours, and it will only popup if that cookie isn't present, and of course only popup if the user is registered, and has opted to receive the tips...
ToraTora!
09-18-2001, 12:32 AM
I was going to suggest checking out a few free java script sites as well...these scripts are plentiful, so there is no need to try and reinvent the wheel here.
The one script i picked up, (but havent bothered using because its a pain in the ass to look at) has over 300 "tips" or "sayings" for the day, in which you can customize them any way you wish. :)
using java/dhtml scripts will not be as powerful as using the DB, with functions to show different tips for different groups, or can you?
Admin
09-18-2001, 06:39 AM
I didn't use usergroups for this, sorry.
I didn't know that's what you wanted until after I started working on this.
Thomas P
09-18-2001, 10:51 AM
Originally posted by The Prohacker
If your still doing this, I just remembered about this cool setup for a tip of the day...
http://www.dynamicdrive.com/dynamicindex11/tod/tod.htm
That'd be awesome!
-Tom
Originally posted by FireFly
I didn't use usergroups for this, sorry.
I didn't know that's what you wanted until after I started working on this.
its ok to start now without user_groups, and i think it is easier afterwards to duplicate the hack and add permissions based on users_Group_ID.
Admin
09-25-2001, 08:10 PM
Ok, here it is.
This might not be the best way to do this, but well, it's something.
I'm just packed with jobs lately, just can't do them all.
And since I do have some previous commitments (yes, even earlier than this one), I must complete them first.
Veyr sorry, Ruth.
1. Run this query:
CREATE TABLE tip (
tipid SMALLINT(5) not null AUTO_INCREMENT,
title VARCHAR(100) not null,
tiptext MEDIUMTEXT not null,
PRIMARY KEY (tipid)
)
2. Save this as tip.php, and upload to your main folder:
<?php
error_reporting(7);
require("./global.php");
$action = trim($action);
if (!isset($action)==0) {
$action = "showtip";
}
// ################################ start quick rate ###############################
if ($action=="showtip") {
$tip=$DB_site->query_first("SELECT * FROM tip ORDER BY rand()");
echo("$tip[tipid]");
eval("\$showtip = \"".gettemplate("tip_showtip")."\";");
}
eval("dooutput(\"".gettemplate("tip_main")."\");");
?>
3. Save this as tip.php and upload to your admin folder:
<?php
error_reporting(7);
require("./global.php");
cpheader();
if (isset($action)==0) {
$action="edit";
}
// ########################### Start Doadd ##########################
if ($action=="doadd") {
for ($i=1; $i<=$numtips; $i++) {
if ($tiptext[$i]!="" and $title[$i]!="") {
$DB_site->query("INSERT INTO tip (tipid,title,tiptext) VALUES (NULL,'".addslashes($title[$i])."','".addslashes($tiptext[$i])."')");
}
}
$action="modify";
echo "<p>Record added</p>";
}
// ############################ Start Add ###########################
if ($action=="add") {
doformheader("tip","doadd");
for ($i=1; $i<=$numtips; $i++) {
maketableheader("Tip #$i");
makeinputcode("Title","title[$i]");
maketextareacode("Tip Text<br>(You may use HTML)","tiptext[$i]","","10");
}
makehiddencode("numtips","$numtips");
doformfooter("Add");
}
// ########################## Start Preadd ##########################
if ($action=="preadd") {
doformheader("tip","add");
maketableheader("Add new tips");
makeinputcode("Number of tips to add","numtips","1");
doformfooter("Start");
}
// ########################## Start Modify ##########################
if ($action=="edit") {
$tips=$DB_site->query("SELECT * FROM tip");
$i=1;
while ($curtip=$DB_site->fetch_array($tips)) {
if ($title[$curtip[tipid]]=="" or $tiptext[$curtip[tipid]]=="") {
$DB_site->query("DELETE FROM tip WHERE tipid='$curtip[tipid]'");
echo "Deleting tip #$i ...<br>";
} else {
$DB_site->query("UPDATE tip SET title='".addslashes($title[$curtip[tipid]])."',tiptext='".addslashes($tiptext[$curtip[tipid]])."' WHERE tipid='$curtip[tipid]'");
echo "Saving tip #$i ...<br>";
}
$i++;
}
$action="modify";
echo "<p>Done</p>";
}
cpfooter();
?>
4. Save this as tip_main template:
{htmldoctype}
<html>
<head><title>Tip of the moment!</title>
$headinclude
</head>
<body>
$showtip
</body>
</html>
5. Save this as tip_showtip template:
<normalfont><b>$tip[title]:</b><br><br>
$tip[tiptext]</normalfont>
6. In index.php of the admin folder add this:
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Tips"); ?>
</table>
<a href="tip.php?s=<?php echo $session[sessionhash]; ?>&action=preadd"> Add </a> |
<a href="tip.php?s=<?php echo $session[sessionhash]; ?>&action=modify"> Modify </a>
</td></tr>
right BEFORE this:
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("Avatars"); ?>
</table>
<a href="avatar.php?s=<?php echo $session[sessionhash]; ?>&action=upload"> Upload </a> |
<a href="avatar.php?s=<?php echo $session[sessionhash]; ?>&action=add"> Add </a> |
<a href="avatar.php?s=<?php echo $session[sessionhash]; ?>&action=modify"> Modify </a>
</td></tr>
That's it.
This will display a random tip on every page load.
I understand if you don't want to use this, it's far from perfect.
Sorry again. :(
Thanks so much FireFly :)
it is better than nothing, i'll try it soon...
thanks again for your time...you are great :D
inetd
09-26-2001, 12:10 PM
Do you have demo or screenshot's?:confused:
sysmom
09-26-2001, 06:13 PM
Although there's no vB admin interface to it, last week I quickly wrote up a bare bones little "verse of the day" script that works with a client's vbPortal.
It reads from a two field flat file and spits out a new one every day.
If this little scrap of code would be helpful to anyone, please let me know.
It could be used for quotes, tips, well, you know... :)
deb
FireFly, i think the modify link in the CP is not working, besides what is the command to show tips in the pages?
Admin
09-28-2001, 12:47 PM
Use this code in the pages:
$tip=$DB_site->query_first("SELECT * FROM tip ORDER BY rand()");
echo("$tip[tipid]");
eval("\$showtip = \"".gettemplate("tip_showtip")."\";");
and just add $showtip wherever you want it.
Looks like I forgot a big part from the tip.php file, I'll find it in a min.
shadowbreed
09-28-2001, 11:24 PM
Any idea why the modify option won't work?
Admin
09-29-2001, 07:01 AM
Yeah, I forgot that whole part from my file, and now it's not in my file anymore! :(
I guess I'll have to re-write it.
Arrgh...
Originally posted by FireFly
Yeah, I forgot that whole part from my file, and now it's not in my file anymore! :(
I guess I'll have to re-write it.
Arrgh...
any updates?
thanks
can anyone finish this hack?
and the ability maybe to make usergroups defined.
thanks
inetd
03-12-2002, 06:18 PM
Hello!
This is very good idea!
FireFly, sorry for anxiety, you will complete this hack? Please, please, please! :)
Psychdrone
03-12-2002, 09:18 PM
heh all you gotta do is find a random script like at hotscripts, and just tie that in to Vb
eh if FF, dosn't realease this, I will finnaly crack down and release a hack:P
dreck
01-07-2005, 04:42 PM
Did this hack ever get finished or is there a hack similar to it?
dreck
01-16-2005, 05:41 PM
Can this code be used to do something similar? I want to do a tip of the day on my automotive forum. I was thinking it would be at the top of the pages like the message for unregistered users:
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Using a Phrase Varname like:
$vbphrase[tip_of_the_day]
But what I need is a way to make it revolve from a list of say 30 tips.
Can someone point me in the right direction?
cmiller1014
05-18-2005, 02:33 AM
Bump, anything out there like this?
Neutral Singh
05-18-2005, 10:52 AM
Would it be nice if we could pick out an item from FAQs and randomly show a small box called Tip of the day on the lines of yahoo groups... it would really helpful in introducing new features to forum automatically like just creating a new entry into FAQ section and displaying it in the box... i am surprised no body is working on such a hack... if it has already been made please guide me to it...
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.