w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to redirect site.com/forum/index.php to site.com/forum/
In .htaccess there are basically two things you can do regarding url's. Rewriting url's You can rewrite url's internally. If the user visits yoursite.com/forum/ you can rewrite the url internally to use yoursite.com/forum/index.php. The user will see yoursite.com/forum in their address bar. In an .htaccess file, this would be written as: RewriteRule ^forum /forum/index.php [L] RewriteRule indicates that it should rewrite the url. ^forum matches the forum part in yoursite.com/forum/ and /forum/index.php says that it should rewrite the url to /forum/index.php. Last [L] means that if this RewriteRule matches, it should stop matching rules. Redirecting url's You can redirect an url too. This will send an header to the client to load a different page instead. If the user visits yoursite

Categories : PHP

SQL Add Sum Row for Week and At the End Add the Grand Total
You should give us more information on data structure. Assuming that your [Date] column is of type datetime, and that you want all your date/week total/month total in one column: set datefirst 7 select case when grouping(cast(datepart(week, [Date]) as varchar(255)))=1 then '<monthtotal>' when grouping(cast([Date] as date))=1 then '<weektotal>' else cast(cast([Date] as date) as varchar(255)) end as Period ,CallsNotRecieved = sum(CallsNotRecieved) ,NumberOfCalls = sum(numberofCalls) from <yourtable> group by grouping sets( (cast(datepart(month, [Date]) as varchar(255)), cast(datepart(week, [Date]) as varchar(255)),cast([Date] as date)), (cast(datepart(month, [Date]) as varchar(255)), cast(datepart(wee

Categories : Sql Server

Grand Central Dispatch without blocks
Yes you can, as stated on the article: You can use GCD without blocks, via the _f variants provided for every GCD function that takes a block If you look at the GCD documentation you can check the variants. If you need a quick example there are many on SO:

Categories : IOS

Subtotals and grand totals SQL Pivot
My suggestion would be to look at using GROUP BY ROLLUP to get the total rows. The basic syntax if you were hard-coding the query would be: select case when region is null then 'Grand Total' when citypair is null then region +' Total' else region end region, coalesce(cast(citypair as varchar(10)), '') citypair, sum([8]) [8], sum([9]) [9] from ( select region, citypair, month, total from yourtable ) d pivot ( sum(total) for month in ([8], [9]) ) piv GROUP BY rollup(region, citypair); See SQL Fiddle with Demo. Then to use your dynamic SQL version you could alter the code to use: -- Creates dynamic values for pivot table DECLARE @cols AS NVARCHAR(MAX), @colsRollup AS NVARCHAR(MAX), @query AS NVARCHAR(MAX) select @cols = STUFF((SELECT ',' + QUOTE

Categories : SQL

Incorrect Grand Total in Magento
You could check the configuration "Apply Discount on prices -> including tax / excluding tax" if it's set to including tax. You'll find it in System->Configuration->Sales->Tax->Calculation-Settings.

Categories : Magento

How do I find the forum id in disqus
The forum ID is the disqus_shortname used in the embed script. I found this in the documentation: http://disqus.com/api/docs/forums/details/ Looks up a forum by ID (aka short name)

Categories : Misc

Forum posts not showing
in your create_topic.php on line 33 <input type="hidden" name="cid" value"<?php echo $cid; ?>" /> Your are missing the "=" <input type="hidden" name="cid" value="<?php echo $cid; ?>" />

Categories : PHP

Disqus Forum - such thing, or even possible?
Seen a few people using disqus as a forum and I'm actually planning to do so myself. There's www.moot.it which can be used as a commenting system and also as a forum, but I don't quite like a few things about it. Regarding setting disqus up as a forum board, you need to make a small app that would allow your users to create pages / topics / posts, whatever you want to call them.

Categories : Misc

Yet Another Forum: Installation Error
In retrospect, paying closer attention to the sql statements and experimenting a bit could've solved the problem. http://forum.yetanotherforum.net/yaf_postsm60154_ERROR--Invalid-object-name--sys-indexes.aspx#post60154

Categories : Dotnet

PHP today / yesterday in forum
In php the syntax is: } elseif( /* conditions */ ) { Although if there are no conditions, simply do } else { UPDATE: See comments if( date('Ymd') == date('Ymd', strtotime($mytime)) ){ $day_name = 'This day'; } else { $day_name = 'Another day'; } echo $day_name;

Categories : PHP

My Grand Central Dispatch usage: Am I using it correctly?
This is basically correct. Dispatch the data retrieval to the background queue, and then dispatch the model and UI update back to the main queue. Well done. In terms of its being slower, I don't see anything there that would account for that. GCD introduces some overhead, but generally not observable. It may be a bit of a "watched kettle never boils" issue. A couple of unrelated thoughts, though: I might suggest moving the sort to outside of the for loop, but before the reloadData. You're sorting it 150 times. If doing an insertion sort, you could do it within the loop, but I don't think that's happening here. I'd move the sort to the end of the loop. I'm not sure if the performance gain will be observable, but there should be some modest improvement. You might want to make sure data i

Categories : IOS

Displying Grand Total of groups in Grid
To display the summary for all of the groups you will want to set the SummaryDisplayArea on the UltraGridOverride that has GroupByRowsFooter and a location for it as well. There is an example in the Display Summary Footers for All GroupBy Rows topic in the help. The following is the C# code from the help topic: private void customersUltraGrid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { this.customersUltraGrid.DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.True; this.customersUltraGrid.DisplayLayout.Override.SummaryDisplayArea = SummaryDisplayAreas.GroupByRowsFooter | SummaryDisplayAreas.TopFixed; }

Categories : C#

Select grand parent element attribute
Use the following: $(this).closest('li').attr('title'); closest() returns the first element from the ancestors of the $(this) jQuery node/object which matches the selector (li) passed to the method, and will then access its title attribute. The benefit of using closest() (in place of parent()) is that closest() requires less prior knowledge of the DOM structure, and allows for other ancestors to be inserted between the two (so if the input is wrapped in a new div, or fieldset, it doesn't matter; closest() will still work). References: attr(). closest().

Categories : Jquery

trying to multiply subtotal with a shipping % to get grand total
Ryan, You just have to write <span class="TextB">Total: $<?php echo ($SHOWMEQ*3/100)+$SHOWMEQ;?></span> It will display total amount along with 3% shipping and handling charges.

Categories : PHP

Retrieving conversations from Samsung Grand :Android
Try this code, public List<String> getSMS(){ List<String> sms = new ArrayList<String>(); Uri uriSMSURI = Uri.parse("content://sms/inbox"); Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null); while (cur.moveToNext()) { String address = cur.getString(cur.getColumnIndex("address")); String body = cur.getString(cur.getColumnIndexOrThrow("body")); sms.add("Number: " + address + " .Message: " + body); } return sms; } try to set selection as date between date('now', '-1 day') and date('now'), remove selectionArgs Update: Cursor cur = getContentResolver().query(uriSMSURI, projection, "datetime(date/1000, 'unixepoch') between date('now', '-1 day') and date('

Categories : Android

Select statement where Users.ID=Forum.ID
You have to perform this operation within your application, MongoDB does not allow joins. See the following two links for more information: http://docs.mongodb.org/manual/core/data-modeling/ http://docs.mongodb.org/manual/tutorial/model-embedded-one-to-many-relationships-between-documents/ What you'll want to do is query on the first document, get the id in your application, then query on your second document. If this is a common use case for you then you should consider embedding your subdocument into the main document if possible. Otherwise, MongoDB might not be the right tool for you; there's nothing wrong with using SQL if it's the right tool for the job.

Categories : Mysql

Django Forum App Project Structure
Start by integrating your legacy database and then build the Admin site. You'll see how the model information is available to the Admin app and every other app you write. The key is to import models in your apps.

Categories : Python

mail website forum under one database
Having multiple applications (forum, wiki, ...) access the same database is not likely to have any effect on CPU usage, but there are other drawbacks: Table names used by applications might have conflicts (many of them might have a "session" or "posts" table). Some web apps have a feature to prefix table names with a string, like "wp_session" and "wp_posts" for example to get around conflicts. Yes, it's less secure. When one of the applications has a security hole and someone manages to access its database, data of all applications is compromised. Multiple databases is likely to be easier to manage when doing application upgrades, backups, removing or adding applications to the mix. Accidentally break one database, and you'll break all apps. To get the applications use the same authent

Categories : Mysql

IBM Connections - get all followers of a Forum topic
AFAIK, that information is not available via the API. You can get a list of the resources followed by the authenticated user via the Following API, but that does not work for any other users (I assume due to privacy issues). You could fetch it the info you are looking for from the database via SQL statements, but that is not officially supported, as the databases could/will change with every product update. In the IBM Connections Forum at developerworks, there is an example for Communities.

Categories : Api

php code, (database, forum) error
$sql = "SELECT post_id, post_title FROM forum_post WHERE forum_id=1 AND post_type='o'"; should be $sql = "SELECT post_id, post_title FROM forum_post WHERE forum_id= ? AND post_type='o'"; Now, you will bind your parameter to this query.

Categories : PHP

Determine which page a forum post is in
Assuming you are displaying the posts ordered by the id, you can do this: SELECT COUNT(*) FROM posts WHERE topic_id = 8976 AND id <= 15 This will give you the position of the post with the id 15 for example. Now you can check what page this position is on: $page = floor($position / 10); So in this example, post 15 is on page 2.

Categories : PHP

Unlocked Forum Post saying it's locked?
I can not see you data so it's a guess use onyl ==0 not ===0 if (logged_in() === true) { if ($mythisql1['locked']==0) { ?> or if $mythisql1['locked'] is a string if (logged_in() === true) { if ($mythisql1['locked']=='0') { ?>

Categories : PHP

How to hide grand total from chart (ssrs over olap)
Ok i figured it out luckily. The problem was that my dataset returned the total, so i just filtered it in dataset filter expression. I'm pretty sure there is a way not to return total inside dataset in the first place, if anyone knows, i will be glad to learn

Categories : Reporting Services

Debugging with semaphores in Xcode - Grand Central Dispatch - iOS
You can print debugDescription of the semaphore object in the debugger (e.g. via po), which will give you the current and original value (i.e. value at creation) of the semaphore. As long as current value < 0, dispatch_semaphore_wait will wait for somebody else to dispatch_semaphore_signal to increment the value. There is currently no automatic built-in way to trace calls to dispatch_semaphore_signal/dispatch_semaphore_wait over time, but that is a useful feature request to file at bugreport.apple.com One way to trace this yourself would be by creating symbolic breakpoints on those functions in Xcode, adding a 'Debugger Command' breakpoint action that executes bt and setting the flag to "Automatically continue after evaluating" the breakpoint. Another option would be to use DTrace p

Categories : IOS

Display grand total as the sum of averages (custom subtotal)
Try adding this into a new column as a test: RunningValue(Avg(Fields!MemberCount.Value,"RowGroup_Category"),SUM,Nothing) If the value is correct you should be able to change SUM into MAX when setting this expression in the grand total field. You can refer to the total like code.TotalMemberCount instead of using a get function but i don't think you need this function in this case. Check the following blog for a simular variable referencing situation

Categories : Asp Net

Text to HTML converter for making forum
most popular code for forum is somehow like: BBCode Wiki Format Markdown or tookit like http://ckeditor.com/

Categories : Javascript

Replacing Text In a Textbox in Continues Forum
Why not update the underlying data source via SQL? Option Compare Database Option Explicit Private Sub Form_Load() DoCmd.RunSQL "UPDATE myTable SET myField = myField + 'Test'" End Sub

Categories : Vba

HtmlUnit automating forum posting on vbulletin
some example 1.choose drop down // select option ALL HtmlSelect select = (HtmlSelect) currentPage.getElementByName("index"); HtmlOption option = select.getOptionByValue("All"); select.setSelectedAttribute(option, true); 2. // Enter text HtmlInput queryInput = currentPage.getElementByName("query"); queryInput.setValueAttribute(searchValue); 3. // click button HtmlSubmitInput submitBtn = currentPage.getFirstByXPath("//input[@value='Search']"); currentPage = submitBtn.click();

Categories : Java

How can I "limit" the page numbers of a forum/blog in PHP
I think you could do a check in there of If ($total_pages > 2) { $total_pages = 2}; $c = $this->db->selectAssoc( $this->db->Select('*', 'forum_categories ,forum_thems', "`forum_categories`. `lang` = '" . $l. "' AND `forum_thems`. `id_categories` = `forum_categories`.`id`")); $total_pages = count($c) / 25; if ($total_pages >2) { //limit to two pages $total_pages = 2; } $p = "<div class="pageCounter_box">Pages:"; if (empty($_GET['p'])) { $_GET['p'] = 1; }

Categories : PHP

How to handle high volume comparisons and then grand totals of scores
It sounds to me like you need to modify your data structure in order to efficiently solve the problem. I'd try starting with a vertical structure and see if you can solve it that way first. data have; array people[40]; do _n_ = 1 to 16; do _t_ = 1 to dim(people); people[_t_] = 20*ranuni(7); end; output; end; drop _:; run; data have_vert; set have; array people[40]; do person = 1 to dim(people); people_value = people[person]; obs_value = _n_; output; end; keep person people_value obs_value; run; That way you have 3 variables instead of 40. Now do your analysis (I don't follow it well enough to complete it, but it should be easy enough). You could also try just flipping (people as rows, observations as columns) if that's easier. To answer the particular questions you

Categories : Sas

add even-listener to a button on timeline that is a grand child of a movie clip
Try this: // Pass mouse events to children optContainer.mouseChildren = true; optContainer.optBeach.mouseChildren = true; // Reset hit area optContainer.hitArea = null; optContainer.optBeach.hitArea = null; // Reset masks optContainer.mask= null; optContainer.optBeach.mask= null; Also check whether on each key frame button have name.

Categories : Actionscript

Nested aggregate error with SSRS subtotal and grand total
Based on your description above, it seems like you're working out Contribution to the Classification level, e.g. Equities, Fixed Income. As such, when working out the total ACB for detail rows you need to work out the total in that particular Classification Scope. Consider some simplified data: I've called this DataSet Performance and have constructed a report based on it: For the row level Contribution I used the expression: =Fields!ACB.Value / Sum(Fields!ACB.Value, "Classification") * (Fields!TotalGain.Value / Fields!ACB.Value) Here the Scope of the SUM expression is the group level. For the sub total I used the expression: =Sum(Fields!ACB.Value) / Sum(Fields!ACB.Value, "Classification") * (Sum(Fields!TotalGain.Value) / Sum(Fields!ACB.Value)) To me, these two expressio

Categories : Reporting Services

getting null on current location on Samsung Galaxy Grand android?
Check this for the answer, for short To programmatically kick start your app for "current location" run the following code before you call getLastKnownLocation YOUR_APPLICATION_CONTEXT.getLocationManager().requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, new LocationListener() { @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void onLocationChanged(final Location location) { } }); Some recommendations for fixing GPSTracker issues may be, to set it as 1 min 1 meter private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; private static final

Categories : Android

Best way to pass data objects to Grand Central Dispatch Task
You said: What concerns me with objective C blocks is this: Variables accessed by the block are copied to the block data structure on the heap so that the block can access them later. Copied pointer references could mean multiple threads are accessing the same object. Yes, capturing pointers in blocks and then accessing/mutating their pointed-to memory could lead to non-interlocked accesses. The typical approach is to use immutable data structures. For instance, you could make an NSData object and because it's NSData and not NSMutableData you know that it cannot change. Capturing a pointer to that NSData in multiple blocks is fine, because one block cannot change the contents of the data out from under another. If you need shared mutable state between blocks that can execute

Categories : Objective C

Running a symfony2 app using nginx and phpbb3 forum alongside each other
add the /forum location in nginx location /forum { root [path to www]/forum; try_files $uri $uri/ [index location]; } I haven't used phbb3 before, so I don't know the exact index location for it.

Categories : Symfony2

How do I use MySQL Join to sort forum threads by their last reply?
SELECT ... , MAX(m.date_posted) AS latest_reply ... GROUP BY t.thread_id ORDER BY latest_reply DESC ... But why is date_posted a TEXT? Shouldnt it be a datetime, or maybe a int (if a timestamp) Because will never be able to optimize running MAX on a text column, would suggest using MAX(m.message_id) AS latest_reply instead, which as messages are probably inserted in date order, should be equivient. Edited to add: The query written out in full... $query = " SELECT t.thread_id, title, MAX(m.message_id) AS latest_reply FROM forum_threads AS t LEFT JOIN forum_messages AS m ON t.thread_id = m.thread_id WHERE t.child_id = ".$board_id." GROUP BY t.thread_id ORDER BY latest_reply DESC LIMIT ".$starting.", ".$this->user['results_per_page'];

Categories : PHP

How to serve static files in forum subfolder on nginx?
Replace if ($request_uri ~* "^/qa/") { rewrite ^/qa/(.*)$ /qa/index.php?qa-rewrite=$1 last; } with location ~ /qa/(.*)? { try_files $uri /qa/index.php?qa-rewrite=$1&$query_string; } also the block if (!-e $request_filename) { rewrite ^(.+)$ /index.php?$1 last; } is better to be moved inside the / location and converted into try_files location / { index index.php index.html; try_files $uri /index.php?$request_uri } if you still are having trouble please tell me.

Categories : PHP

How do I count the number of replies in a board of my custom forum?
This should do it. $query = " SELECT COUNT(*) FROM forum_messages A, forum_threads B WHERE A.thread_id = B.thread_id AND A.message_id != B.first_msg_id AND B.board_id = " . mysqli_real_escape_string($dbc, $board_id) . " "; $rs = mysqli_query($dbc, $query); list($count) = mysqli_fetch_array($rs); echo $count;

Categories : PHP

PHP/Mysql Create thread then redirect to forum category
echo "<META HTTP-EQUIV='Refresh' Content='0; URL=/category.php?id=" . $topic_cat . "'>"; That should work. You needed to put double quotation-marks outside the . $topic_cat . variable like so; " . $topic_cat . "

Categories : PHP

Get Latest Topic for each category in Forum Home Page in CodeIgniter
You can try this, Hope it helps: function get_all_categories() { $data = array(); $get_categories = $this->db->get('categories'); $cat = $get_categories->result_array(); foreach( $cat as $key=>$each ){ $rs = $this->db->where('topic_cat_id', $each['cat_id'])->oreder_by('topic_id', 'desc')->get('Topics', 1)->row_array(); $data[$key]['cat'] = $each; $data[$key]['top'] = $rs; } echo "<pre>";print_r( $data ); return $data; }

Categories : PHP

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.