View Full Version : Random Journal
Milad
03-03-2006, 05:39 PM
Module version: 1.0.0
vBulletin version: 3.5.x
Assuming you have vB Journal and vBadvanced CMPS 2.1.0 installed.
Tested with: vB Journal 1.0.2 Beta 1 and vBulletin 3.5.4
Description: This picks up a random journal (from vB Journal) and displays its title, description, (number of entries, views and comments) and the latest entry title with date and time. (see the attached screen shot).
Installation:
In the file cmps_index.php (or whatever you had renamed it.)
Find:
require_once('./includes/vba_cmps_include_template.php');
Above Add:
$phrasegroups = array_merge($phrasegroups, array('journalhack'));
Upload the module file randomjournal.module
Click http://www.vbulletin.org/forum/images/smoothblue/buttons/installed.gif (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=109383) to receive updates.
Done! Thank you, feel free to suggest.
ChangeLog:
Mar, 3rd 2006: (1.0.0) Initial release
psilocybin
03-08-2006, 01:45 PM
thanks Milad
CallieJo
03-09-2006, 05:40 PM
Do you plan on making a latest journal hack?
Thanks:)
Praetorian
04-30-2006, 07:44 AM
Can this be modified to only select one journal per day... per month... per week... ect? That would be really cool.
djtaz
05-20-2006, 09:20 AM
i have vba cpms 2.0 installed and i dont have:
require_once('./includes/vba_cmps_include_template.php');
my index is like this
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'adv_index');
define('VBA_PORTAL', true);
define('VBA_SCRIPT', 'CMPS');
$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();
require_once('./global.php');
print_portal_output($home);
is there any way to get this module working ?
djtaz
06-19-2006, 09:32 AM
anyone ?
djtaz
06-19-2006, 07:39 PM
THIS IS NOT TESTED AS A MODULE
Ok i got this working - and i also edited it so that instead of random journals , it shows the last 5 entries in the journals - and it has an Update your journal now button on it to encourage entries.
I have it working on my own boards and i dont want to uninstall it to test the module install, but as far as i can see it should work ok.
I can talk someone through how to do it manually if theres any issues with this , but if someone has a test board they want to try it on that would be even better.
I hardcoded the english words into the top of the module because i didnt have time to get the phrases working on my own board , so it'll stay like that unless someone else wants to re-code it to a better standard.
Monty NC
08-03-2006, 07:47 PM
djtaz - I would like to get that module working. Your code refers to two templates that are not included in the zip:
adv_portal_journalbit1
adv_portal_latestjournals
Would you be willing to share those templates? Thanks.
djtaz
08-04-2006, 02:46 AM
avd_portal_journalbit1 :
<tr>
<td class="alt1" width="100">
<a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$randj[journalist_id]" class="smallfont">$randj[journalist]</a>
</td>
<td class="alt1" width="40"><center>
<span class="smallfont">$randj[entrycount]</span>
</td>
<td class="alt1" width="40"><center>
<span class="smallfont">$randj[journalviews]</span>
</td>
<td class="alt1" width="40"><center>
<span class="smallfont">$randj[commentcount]</span>
</td>
<td class="alt1">
<a href="$vboptions[bburl]/journal.php?$session[sessionurl]do=showjournal&j=$randj[journal_id]#e$randj[lastentry_id]" class="smallfont">$randj[lastentry] </a>
</td>
</tr>
advportal_latestjournals
<tr>
<td class="alt2" width="100">
<span class="smallfont">Journalist</span>
</td>
<td class="alt2" width="40">
<span class="smallfont">Entries</span>
</td>
<td class="alt2" width="40">
<span class="smallfont">$vbphrase[views]</span>
</td>
<td class="alt2" width="40">
<span class="smallfont">Comments</span>
</td>
<td class="alt2">
<span class="smallfont">Last Entry</span>
</td>
</tr>
$latest_journal
<if condition=($journalsid != "")>
<tr>
<td class="alt2" colspan=5>
Update Your Journal Now : <a href="journal.php?do=addentry&j=$journalsid">
<img src="images/buttons/newentry.gif" border=0 width=100></a>
</td>
</tr>
</if>
they should be coded into the module ?
are they not ?
upload the vbjournal.php to your /forumroot/modules folder and add the module to the admincp ... pointing to the vbjournal.php and including the 2 templates.
You can see it working at ... http://www.theotherzone.com
Monty NC
08-04-2006, 08:01 AM
Sorry, I see that now. I got this message when I tried to upload the module in CMPS:
The file you have uploaded is not a valid module file.
I didn't realize that was the template code. I just created the new templates with cut & paste, and added the new module manually -works fine. This is exactly what I wanted - Thanks!
djtaz
08-05-2006, 06:07 AM
Milads journal was almost what i wanted - a little playing about with it got me exactly what i wanted - and it really does make more people use the journals section on the site :D
Glad that worked.
Monty NC
08-08-2006, 01:02 AM
It took me a while to figure out what the bug was, but I finally figured it out. The string created in vbjournal.php is named $random_journal, but the template adv_portal_latestjournals calls for $latest_journal. To work properly, vbjournal.php should be edited as follows:
Change this:
eval('$random_journal .= "' . fetch_template('adv_portal_journalbit1') . '";');
To this:
eval('$latest_journal .= "' . fetch_template('adv_portal_journalbit1') . '";');
NOW it works PERFECTLY! :D
djtaz
08-08-2006, 05:30 AM
Were you using the original VbJournal.php or the module that i posted up above ?
Glad you have it working now anyway
Monty NC
08-08-2006, 01:00 PM
I was using your modified version of vbjournal.php that you posted above. It has the proper (modified) names for the templates, but the string name is wrong. Of course, you could also just change $latest_journal to $random_journal in the adv_portal_latestjournals template and accomplish the same thing. :) Thanks again for sharing your module.
aware
08-11-2006, 10:00 PM
please someone tell me what im doing wrong!im
uploading the vbjournal.php to my modules folder .then im trying to upload latestjournal module but its says that is not a valid module file!
aware
08-12-2006, 09:40 PM
any help here????
angkor408
08-30-2006, 09:14 PM
Hi, Now i got it work. how come when I post new journal I got this error msg:
Invalid Journal specified. If you followed a valid link, please notify the administrator
kamil5
09-11-2006, 08:18 AM
thanx good job
centerlviv
12-22-2006, 10:41 AM
Fixed......
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.