|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
+ l3 a L0 M; q$ Z- Z7 I4 ~// Theme Option
: ~# Q+ }8 b, h- e1 R6 V////////////////////////////////////////////////////////////////////////////////
" X2 v j [4 R0 X0 Y8 d
+ C/ ~( s/ ~9 {( a! q( h6 s; C$themename = "Zenx";+ d# I4 k/ P/ D) [
$shortname = str_replace(' ', '_', strtolower($themename));4 r! d& O4 {- P/ |
5 \+ J5 k, r5 a0 f. F e% |function get_theme_option($option)/ I8 X$ g" o N+ ^1 F
{0 w( O% v7 [# |& m6 {
global $shortname;0 H5 k' g9 E. T' e3 N! h
return stripslashes(get_option($shortname . '_' . $option));
+ J r& V$ x8 Y* t}- D3 d1 n3 t/ v \& n5 Y( U
# @( J* U7 z X% y, {7 xfunction get_theme_settings($option)- x8 N4 w' p) Y: [/ U
{ w' ]( {! L5 d) d# Y7 _
return stripslashes(get_option($option));! M" M. p+ Z' [* o- A; X) t
}
5 q9 [3 X5 O" m8 ]% j. \- ~$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");- k2 P! A3 ]7 q6 g- G% M
$wp_getcat = array();1 z. V& @" o# m; \# t3 R
foreach ($wp_dropdown_rd_admin as $category_list) {
" Q& [, O. S5 r$wp_getcat[$category_list->term_id] = $category_list->name;
6 p* u r% T# ^8 h- n( S3 e}6 k5 r2 \3 x1 _) x$ C0 M9 c
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");7 F: ~4 y2 H7 y; K1 s- f2 Y
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");3 ~8 O5 f7 n$ }) A4 l
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
/ E* \6 t3 W9 m6 k! o: a, c3 Q% a
1 r0 N0 z7 j9 [4 q$options = array (7 q3 i5 Y. R3 Z4 X4 a
* @3 A2 ?* u' I2 Y5 C' z* Z* B
/ o' J8 [+ P# W/ y! _ array( "name" => "Blog Header Settings",
, e; v0 p4 H. n8 ` "type" => "heading",2 @' W/ I3 G1 R. l% I# O4 a/ L
),0 b# [: {& F; l/ ]- w# S$ b
4 `) x1 a7 Y r h+ v( S$ h s array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: B5 @7 |" p Q: l+ W* D
"id" => $shortname."_header_logo_activate",
. r$ a. W0 ]/ l& c s: ^2 ] "type" => "select",; S" m2 n: C. A' b( N5 A- O/ @
"std" => "No",2 v9 M! W9 o' A8 @9 W
"options" => array("No", "Yes")),. J( d* N6 ~* n
% Z2 w/ V. E* D f0 B0 P
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
' a$ V9 j9 v. [% D% h4 ~7 @ P "id" => $shortname."_logo_url",6 l( M: |. b1 w- I: |
"type" => "text",; o6 {- S5 l; m7 _) \/ s
"box" => "social",% ~5 K* F( R# `9 m
"std" => "",6 M6 `0 Y2 @4 r9 b9 j( K; c3 C
),
, s9 O* R6 } i/ m( N; ?" \
$ l: ? v$ ^, |% V$ ]6 s$ t1 ~ array( "name" => "Insert Header Banner HTML Code (Header)7 f$ ~; y" A1 w! ^ L+ G
<br /><em>*Recommended Size 468 x 60</em>
+ X z: s( j/ g; w7 \/ @! [4 z <br /><em>*leave blank if not use</em>",/ V) r+ h$ p' S. M1 i, f( { g
"id" => $shortname."_header_banner",6 d- B& s& k2 z
"type" => "textarea",
+ o' B0 \& h4 _4 d* y( a "std" => "",* z2 H+ j+ T% j, }
),
3 V9 i9 {& d K- P& N, X* q' P, C5 v1 I4 B) y. n
array( "name" => "</div></div>",
$ Q; o# F4 u+ p- N "type" => "close",
& y7 A. R5 m: y$ u9 _ ),
8 M! S9 C s- ]& c9 d) k# f7 e- R: G5 ~- Z/ Q; |4 u8 F
: ` E8 B, g) c array( "name" => "Header Navigation Settings",1 c- L$ W" V' i- S& g
"type" => "heading",1 ~5 h0 V! w- P Y1 I. G
),
5 `9 R7 ^- m0 T6 I m/ x O" T: `
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
J# H1 N6 W5 h0 V, K9 {# Y <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />6 T9 @# ~/ I, E' R& l" r/ ~& c
<em>*Enter the page post ID number only</em><br />
/ o" c& |6 x) ^3 y$ d <em>*separate by comma</em><br />' X1 ~0 D/ I& G8 N1 {) `, z
<em>*Exclude pages which you don't want to show on the header navigation</em>",
* A8 y1 X4 V% j# [' I0 p9 |' J: C "id" => $shortname."_header_page_navigation",+ d c4 c) S9 O
"type" => "text",
8 ~# s* T8 n9 v! O9 ~ "std" => "",8 ?# w- j7 Q) U" X0 r5 Z5 ]
),/ u& x/ p: w+ E6 k
. T) B# z3 } z9 K W! W7 O
array( "name" => "</div></div>",% v( x! m: g" E' h
"type" => "close",# ? Y/ m2 s* o4 K' W
),4 f ?% w/ P p4 Y+ j5 i
9 N: d/ h$ Z$ @4 d
2 \0 ^! K- S, k" \) d/ f, z0 v
array( "name" => "Post Auto Thumbnails Settings",1 T: L4 Y( \( O) p
"type" => "heading",7 V/ U3 Z. |2 z. E1 j
),$ m+ o0 V5 |2 T/ m
. P$ B- ]6 J" X+ T
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) M+ A) M7 }- X- A, ~9 M5 C
"id" => $shortname."_timthumb_activate",
: {5 p, d1 C( d9 Y4 y e% m% w6 t "type" => "select",5 K" `! B( P% q+ `) `
"std" => "No",
' S; t) k3 L0 h2 S7 F* N0 M7 T. h( { "options" => array("No", "Yes")),
1 W' g) M3 z& {! G/ P . S+ H5 o6 y3 S1 J0 {, C
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
5 v* S; e9 n! R. g( P "id" => $shortname."_timthumb_cropping",* k" ~7 L* [7 X+ N
"type" => "select",8 c$ w/ M5 W4 u( P8 e
"std" => "", ]& L8 l6 O- ~* w2 ]5 K1 a
"options" => $crop_position),
( _0 o$ b! s* p4 [3 F# D" I0 l+ ~6 \& }
array( "name" => "Insert Width Of Thumbnail Image<br />
) W# V( T/ j9 ]# L: k9 S2 p <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />. F; e& o+ D7 H. b( `
<em>*Leave Blank To Use Default: 250</em><br />",6 Q( w. C* C X6 {
"id" => $shortname."_thumb_width",
! H! _- M" m8 l: T) ]8 M6 o/ o! g "type" => "text",
2 j2 O. i& ~4 Z F "std" => "",1 Z( z, T0 C8 O* S6 f) t) j
),+ A: M: b2 X/ \5 N3 b% h
* P n8 m' U- u1 a+ F( ]$ @
array( "name" => "Insert Height Of Thumbnail Image<br />
; M' |9 l' u5 Z/ Q' Q5 J <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
) [8 G) P" P- { ?8 x& y3 {. Y1 u <em>*Leave Blank To Use Default: 200</em><br />",
+ ?: ]. v1 B4 c" ` "id" => $shortname."_thumb_height",/ ~+ A3 g F+ S/ r9 q" p
"type" => "text",
; y& S: s3 q+ w2 W: R; K9 @" Y "std" => "",$ Y$ p$ K0 J) F; x. C* O. Q
),1 r3 R {; D; F( t5 N
$ F9 z5 E1 d) {. v5 F# H
array( "name" => "</div></div>",) {: j+ d; i5 G7 J) ^7 F
"type" => "close",
" }. V! H1 h" l; e. h' P ),3 K8 {1 F) h/ n$ Q5 M K
+ f7 b; }4 ?# X( N7 X2 i# ] array( "name" => "Featured Content Slider Settings",% X+ b" B" w0 m+ k# a% r
"type" => "heading",
( e/ Z- R* H: R# R/ e ),3 V- L- A" S; z" f6 m" z7 w
8 [3 J- j+ {7 b9 I! S array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" m- k D5 G! Z* G0 M$ t. i6 J8 i: Z "id" => $shortname."_featured_activate",
2 h3 U" _& v4 F( ~$ O7 y3 I "type" => "select",7 r! b4 s- ]7 O$ x: o
"std" => "No",
. ^+ X1 n0 x5 L. R "options" => array("No", "Yes")),4 v9 c f1 }7 k& Y
- ?! ]" L: K' t/ H
- E6 c, R Z7 _$ K, K5 M
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
9 P: }* N2 j* c* J# |4 l/ p* @" Q "id" => $shortname."_featured_category",
6 Q+ F2 n4 ^6 T8 Z "type" => "select",
* r/ ~, t/ f! I0 i# D& \/ k "std" => "Choose a category:",8 m, |/ `: y* {- t0 U$ Z9 z
"options" => $wp_getcat),7 a6 q! H7 e8 d( L" i# }' @
4 E, W8 M0 T! G1 w array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
5 z0 a ~$ V& z5 K1 R3 d5 H, ` "id" => $shortname."_featured_number",
! p& c) ~$ u0 r& ]6 h- O% E; N "type" => "select",) b* j* i& w- ~0 {4 }
"std" => "Number of post:",; o% L* ]) \5 R p a, p- }4 Z5 z
"options" => $number_entries),. ^- o4 V3 b3 O$ H
6 L- H8 y# X) A7 b' Q0 r6 @ array( "name" => "</div></div>",& p' v& c9 R# G1 r& G2 U& P% q$ w
"type" => "close",
* I9 s/ ^9 A7 V# R7 r ),
$ K; B( O& G3 {. Q7 { 7 J. |; }" i6 p- m8 T
array( "name" => "Featured Category Settings",
- n' W8 {9 T/ d' A- h6 T "type" => "heading",0 \ B/ E( V$ @1 {2 m4 e
),* V6 D! O* N4 n+ Q
/ h5 Y" H9 X2 o9 V7 o
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# J4 [( u9 b$ f/ A; p8 w0 _
"id" => $shortname."_featured_category_activate",0 I1 l( B1 t+ q8 f) ?
"type" => "select",
3 [& R- k- y( V L "std" => "No",
: D& a0 ?& a4 s; H; k8 d "options" => array("No", "Yes")),
* ^7 d* k5 ^8 D. q/ \& G/ t* y
! ?! \/ ]/ d# A7 i/ P3 X& J9 k array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",3 C9 _; x7 a w2 Q6 ?/ H
"id" => $shortname."_featured_category_id1",; A- c( w! H" `/ Q7 k
"type" => "select",
# g2 u6 F6 H% s( o- ]' [ "std" => "Choose a category:",
+ F) v2 O/ A' q# e "options" => $wp_getcat),; S' |4 ~$ G- U# d9 @' d8 R
* T0 Y! U! |) p2 a! c7 H$ \+ V
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",2 A4 U2 d) h7 L
"id" => $shortname."_featured_number1",
g& q+ q# f3 u/ `4 W3 M/ S "type" => "select",( |9 H- _! f7 w! g4 h% J
"std" => "Number of post:",
# q- q9 U( j2 T, k" D; v+ Z2 D2 w: e "options" => $number_entries),/ I7 c- V8 y. V% {) z1 b1 n0 ]
' z* k) C/ Y' R* T5 P4 S0 y array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
8 k! G: L: F& P$ z/ R3 B "id" => $shortname."_featured_category_id2",6 Q* M; k, ^' H/ p8 `* o! g5 W
"type" => "select",& B. }$ z- o. o, s% y3 ~* d
"std" => "Choose a category:",
0 W1 A ]" A6 T: k "options" => $wp_getcat),
5 y$ \. j( U. S! h' F: j+ s+ s $ R* a& X5 |$ l. T
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
: c. P) r) w1 e$ I" j5 J ~ "id" => $shortname."_featured_number2",
4 _* i3 M) L! d$ {% l5 _9 u "type" => "select",2 o) X3 ]) x9 |: ?
"std" => "Number of post:",& Y5 u$ p! \9 ^, ?- k/ b, S, j# v2 X
"options" => $number_entries),! [9 L- y. O# y8 m F) o
/ ~8 X" V2 u0 n) K, }2 ^- J7 ]
- e+ F- `( y9 M/ r8 [' c) Q
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",: @7 U# N x4 a
"id" => $shortname."_featured_category_id3",$ v0 _, c! U2 \) @
"type" => "select",! q/ I# V% c( F
"std" => "Choose a category:",) X" i$ _; f( G0 n: L( V. p/ P7 ]
"options" => $wp_getcat),
8 V3 o/ p1 P$ t
# z3 y0 C8 t) ^4 B$ U array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",3 d5 _$ }" [9 U! |" e: \4 S
"id" => $shortname."_featured_number3",5 A( g: W+ }% r) `/ J3 u
"type" => "select",
1 s" P+ |9 M- O "std" => "Number of post:",
- v6 @/ _: R: `) e: |! X, \9 h "options" => $number_entries),% O1 s$ T' V$ i9 S* Z# H; `
. {5 k+ ^; q$ i$ v# G2 T: ]
+ G% T2 _9 a" n" s0 v' _# V. M$ Y array( "name" => "</div></div>",6 `2 N* t$ e# G5 f# E8 ^5 v: }
"type" => "close",
& p. `; T2 q) W$ l( g& P' z ),1 W/ T/ f. V' N0 @/ \ ]
. U: s$ K: a7 k, H; F F- C
: V4 y- j3 s9 y/ p array( "name" => "Google Adsense & Analytics Settings",7 O7 F" b, Q' S2 S4 u% h) }/ p
"type" => "heading",
5 b* P0 G1 S+ J6 N7 F$ Q ),
9 q9 B* w7 c: @0 ~, t- r. @: u" ^: B3 j
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
; y6 P2 t: I# b) S/ ^ @( T7 P "id" => $shortname."_adsense_loop_activate",8 F: _! }3 B. j- j. b: o' G
"type" => "select",
# T+ S4 H% L6 Z! q% _ "std" => "Disable",
4 L/ @3 e5 X) O* R; { "options" => array("Disable", "Enable")),/ `& q2 N7 ^0 R% b
; G) G G2 Z/ m0 ?$ n3 f+ f x array( "name" => "Insert Google Adsense Code For Loops Here<br />
: W* D6 U" i5 g5 M4 m <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
. @3 D4 D& ~) g. e$ t8 M8 ~4 v "id" => $shortname."_adsense_loop",3 E! m( |& h9 j/ f/ \) h$ Y* y
"type" => "textarea",5 x d E$ F" K0 Q" g/ P" A4 D& Q
"std" => "",
( n+ a' T, Z+ I* a ),- N" Z9 F+ P. [& t) e
8 [: r/ D9 B8 c- ^( l array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",( e7 X) M# m/ ]0 a2 V1 N! [- d! S% ^
"id" => $shortname."_adsense_single_activate",
2 j! C* c# L8 l) V "type" => "select",( ]' y l/ j2 X" i
"std" => "Disable",
3 I: ~0 `* q* M$ J1 h& \ "options" => array("Disable", "Enable")),
$ o. v9 J- K2 }# t0 ]# \% K+ g# e2 b/ H
array( "name" => "Insert Google Adsense Code For Single Page Here<br />. J# O: V5 U3 C0 W$ k, X
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",! Q4 P4 f% X2 {% [7 W, ~' V
"id" => $shortname."_adsense_single",: X& F& X9 X% _ Q
"type" => "textarea",
4 o0 T b9 H7 h8 O0 |" X "std" => "",
& i' a. { ]/ l- T. m ),
5 e, F, A6 X; k6 q2 H. R% K0 F4 z4 \7 }2 r, N* P
% ~; M9 E3 ?% m7 m1 d1 `8 n3 r. a2 ]4 ` array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
! p+ _" `! H& N; n* O5 E "id" => $shortname."_google_analytics",# b% B7 G! c" n) A; J$ B7 Y" h1 y
"type" => "textarea",0 z, \" u0 {" q, t0 C8 N
"std" => "",/ ]0 {2 o1 Q+ I) ~7 f2 [
),
2 ~2 D! \4 Y) b: E6 u/ a$ h3 J
. M' q# \3 [, ~ array( "name" => "</div></div>",
: h8 B. T! f$ t3 a5 ^ J "type" => "close",
( X" q9 n6 ?9 x: r+ Y8 N. M ),
+ H) \0 ? I/ ?6 U$ y4 x$ c' j
% s; z# m2 U7 N) J4 X
8 }! ?& K4 Q. F0 R array( "name" => "AddThis Social Bookmarking Settings",. V6 J1 ^* b" u3 ^1 S4 T
"type" => "heading",9 p% r/ L, |: n1 l3 F6 }$ o( V8 L
),* }/ t, s" r$ S }- O2 c
, i) j) h0 w0 S- ]5 s
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em> l& w4 I/ N; I8 R q& D, l
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
+ |. E- b7 M! |7 i "id" => $shortname."_addthis",$ }6 O" a$ I* s5 a4 e
"type" => "text",
- g3 w7 d$ \0 [2 z1 } "box" => "social",
2 X; k! m" B ~$ Z "std" => "",. I) `2 W' z' [2 h/ I
),
5 Z- @0 ]- K7 g6 l5 c4 w$ R3 ]# S& v2 D
array( "name" => "</div></div>",& l- N( T) m% Y0 x, v
"type" => "close", g; ^# G3 c) j
),
4 N4 _- m& i; ^1 G( W 9 @8 K9 d2 O, w3 K
+ ]+ x: c8 l Z# V. W
% E/ Q4 E2 g! ?& w( | array( "name" => "YouTube Video Settings",( o& i o' p: X$ [2 Z4 u" w9 y
"type" => "heading",
4 U' @* E+ a8 g. [8 e: t ),
3 V% z! l h6 O; g9 ^& W8 c$ Z8 Q- ]% N7 ?
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>", K7 [& W& A! a' K0 v# s6 |/ Y# t! \* J
"id" => $shortname."_emvideo_activate",
5 V3 [+ H" Z: q& r2 Z7 i3 ] c- a& B "type" => "select",* ], G8 S# R* k) I, G4 r0 s2 v
"std" => "No",
+ p* F% n6 g V6 _8 e8 a# x5 p1 t "options" => array("No", "Yes")),& V1 P2 H/ A) l5 w c$ c+ u
5 N5 Y: [ D, @5 n! I. V/ ] array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",4 u- V5 F4 p8 L* i. O, c# r( i
"id" => $shortname."_emvideo",; H2 l4 j8 q2 k/ N f9 e9 T
"std" => "",
: q$ j* b/ \2 b! z T "type" => "text"),9 p8 z( M- Z# V
+ y- @& d3 ?9 s1 G& z0 Q8 Y: p0 z array( "name" => "</div></div>",# @9 J3 k& `2 X& M, U) g
"type" => "close",* c! y+ Q6 W! {* }6 l
),6 c. H- f6 j0 \( _% b( `
. D# j/ d g/ d, A/ y. {
array( "name" => "Twitter Settings",: z. i6 B+ c+ Z6 e+ Z' t" }# [9 c/ M5 w
"type" => "heading",1 X2 ]% e7 {4 l( T6 x. {0 V7 Q
),- |3 o% i( I' T
Z3 ^% y) l" T6 k+ N array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) Y0 f$ i2 X: v2 q+ l/ E* o! f9 F
"id" => $shortname."_twitter_activate",
! A5 F% g' {0 g- W, r "type" => "select",
* N8 s6 |' i! l& e "std" => "No",) u7 B$ t7 }) X) e. V
"options" => array("No", "Yes")),
, h- |8 M- G: e8 o, Z, X
3 t+ m8 ^' `9 T0 M array( "name" => "Insert Your Twitter ID here. V9 C1 D3 t& ?9 E
<br /><em>*leave blank if not necessary</em>. G# Q3 O/ a8 k9 n1 P
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
* I) Z1 q, [5 j- c; C. U) y "id" => $shortname."_twitter"," B6 m; Z0 z+ A* i* G
"type" => "text",9 A0 t) X" X" S4 d
"box" => "social",. X- ^' O; a D" U
"std" => "",
2 P6 w" G/ _$ k* H7 f! v3 w ),( a7 L" P! Q9 N# L8 j4 z1 Q
0 P* F9 R) M3 C/ N2 Z1 G array( "name" => "Enter Twitter Feed Count here0 G8 r, X5 L3 |4 ?7 [: m0 A: ?# C% [
<br /><em>*leave blank if not necessary</em>
m7 _& A5 j: i7 Q2 z( D <br /><em>*Enter How Many Twitter Feed To Display</em>",
0 U; n5 W F! A. |# G% u# P "id" => $shortname."_twitter_count",
6 Q& A/ h7 Q/ u0 E+ | "type" => "text",* v$ o" k- V8 {+ [# F: C2 p
"box" => "social",/ E$ n+ ?: J/ W3 ?# C
"std" => "",
! D3 y, S k$ A& t' _ ),
- N# H5 ?2 G2 O) g
7 e' G7 ]& z! t( R1 @1 \! B array( "name" => "</div></div>",1 q/ I5 S( f- ~& b, T1 ?, e. s& }
"type" => "close",9 \ V7 ~4 ?& W- {4 {* i
),4 I. ]# ~/ |8 A$ g" O7 R
3 i# u, l% ]5 l) P8 W
5 i) p' {2 B: Q% B( @3 b7 w- P array( "name" => "125 x 125 Banners Advertisement Settings",
t4 V/ {5 m+ c "type" => "heading",
2 p5 }0 q2 \6 e h5 S ),1 j' W3 I7 W ^) H
! ^0 g8 u5 ?9 P/ Z, W
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- l' d% }: C& n7 F" A
"id" => $shortname."_sponsor_activate",
% L- p l" S5 j# Q "type" => "select",/ D0 `0 B0 |+ I9 q0 R
"std" => "No",
' l) ~) Q8 P& R "options" => array("No", "Yes")),2 Z3 r% y, Y( V) n* g
0 E0 c9 l" n0 n! }
/ B3 i" T5 B, w# d1 ~ c) x
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",3 m0 m& q5 g* n# r2 K( q
"id" => $shortname."_sponsor_banner_one",/ @6 P; O f9 S" s
"type" => "textarea",
4 o4 [7 Q8 g$ ^7 a3 K "std" => "",) C1 Y8 p6 d2 K- r
), * Z' q% J9 E6 x+ m `
. O: y; n5 X% s6 Q! L array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",9 ]" o' u: g5 j8 i9 D- }! K8 d" Z4 ?
"id" => $shortname."_sponsor_banner_two",+ ]2 {3 ]) S; W8 l
"type" => "textarea",
3 ~: ?6 |. ^, T* F "std" => "", i* @1 j3 ` Z2 Z$ r
),. u8 }; t5 y3 I; r2 i
2 `% N" Z4 @/ D; D; l; A8 f array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",+ t- U7 D: y* C" I
"id" => $shortname."_sponsor_banner_three",
5 l! F3 l2 V. V9 U "type" => "textarea",
2 z1 q0 ~: _ C J; |) z "std" => "",
1 I4 K& M: n( P: K6 k$ y ),
8 s. E% Z0 ^3 m: {, `
& T9 g& \. ?( ?! k: k3 Q. r array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
5 N" @' t+ J( `5 T% m "id" => $shortname."_sponsor_banner_four",
: h7 Y7 H0 o, u$ ~# L "type" => "textarea",4 }% f) W0 ~: B9 d: m
"std" => "",
) h1 D) q& r3 b! _7 V5 f ),3 Y( ?' E" A& T/ g2 E8 O" u |
. G3 n; |% j, D. i6 K7 d7 y array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
" G7 {% J( K+ O! x7 { "id" => $shortname."_sponsor_banner_five",
4 T0 ?2 v- H6 b! ^ "type" => "textarea",/ ]3 y6 v8 V# E1 k* m
"std" => "",7 o' Q, N0 P, e$ T0 }0 e$ U \
),
+ [# R Q+ {0 w- W9 N* U
" w7 O2 H8 z; ?4 Y' [: r/ G array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
( \! ~* i) k. n# p4 G+ ? "id" => $shortname."_sponsor_banner_six",
/ z; Z0 z0 {8 y# y8 b7 u "type" => "textarea"," f# ]. u: E$ I0 }. p0 [
"std" => "",) I) v7 e. P/ C0 ?: A) p6 _3 t
),8 v& h( m% ^: u3 g+ _5 T
) ]; p8 e- P: h2 X array( "name" => "</div></div>",
# M- ?7 L5 R l' Y. y9 ~1 |4 E "type" => "close",
2 I' j- ]! i3 W6 u& ?$ F8 F& [ ),
% P. y- u8 ~- J& P% ]5 J
3 B. S- U6 Y, P; O( A# S2 \8 `% Y
e% B3 S7 b! q2 ? G7 y' T% n" e);
7 F2 l- K4 B" F& V: D+ W5 z( T
3 E& i# y# B9 _' F- B0 X# Cfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {7 G( _* U. s9 t' j3 D& R1 o* Q
% z0 b1 T1 c4 W0 z$ D& kecho "<div id=\"admin-options\"> ";
& t" d- Q% r, W4 [
0 x, t. S! {- k; S( kglobal $themename, $shortname, $options;/ t" o6 p- }! ^( E4 S# w
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
% F9 w3 f! R" c" o9 Fif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';3 t J2 M+ h! h x) b2 M
?>
8 ` X% t$ e3 v& m- N6 R# i3 X" g d
<h4><?php echo "$themename"; ?> Theme Options</h4>6 v+ q+ ]5 Q2 t) F
0 [8 H( P; |/ C' g! B9 q# ?
<div class="annouce">
4 L" d; ?8 ]: ^) T<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1> p4 J, l3 M) K/ t8 @# l
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>: n/ r6 X! e2 |/ W; d8 Z9 i
</div>
& l4 u) P d; M) `- g. G
# s2 G: O" d4 ?" B( _0 C<form action="" method="post">
8 f6 J5 i" z+ |7 G# H7 R1 R5 g$ \/ M- c+ n* G! n6 @
<?php foreach ($options as $value) { ?>
/ I0 Z% n f# ^7 j% _( w$ y4 t
% m) o& H: A; R# |. O<?php switch ( $value['type'] ) { case 'heading': ?>( V* |* U; ~, }* y' f! k
0 j' Q {* k( A
<div class="get-option">
; [. m a9 B5 ^$ Q$ Q* Q3 f( v. }2 g& B5 e5 c6 }/ ?6 ]/ J# X+ a
<h2><?php echo $value['name']; ?></h2>
! P' N) v4 B. A: {& F- X6 w
/ Q8 u& h) p5 d1 T) c+ r1 {<div class="option-save">
2 \; N. ?/ B; Y
: c& p) v, r9 D( u0 |$ B8 {, D; T<?php
) W& y, E/ n5 v6 ^break;
}0 {6 G) o+ x* l# z0 Acase 'text':
% H' w- `5 k9 f# S, q) f?>
4 C0 P! _! T# O/ R; ~" w0 m0 I
$ C2 J+ [( { ]<div class="description"><?php echo $value['name']; ?></div>) Y8 ~0 R0 Z8 K
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (. x. F* W& J' _* L7 R* r
% e& A0 i9 d: G* z! B2 ]$ b
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>& f$ `* u$ ^5 j3 U
. J* J; U8 B" }2 L4 A- H9 e
<?php) C1 q; W& |; x/ L" l9 J$ v
break;
' T5 ~" y! o# G' i0 I- icase 'select':
4 q0 V3 G; _% S: v?>
; b8 m6 g2 S6 ?- |
1 y T( ^0 e0 y) h# N, ?<div class="description"><?php echo $value['name']; ?></div>6 {( H9 ^# `- i4 t7 R6 g
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
3 g* N/ K" p! v7 l# G- I<?php foreach ($value['options'] as $option) { ?>
) h% c& U! F8 ?* X& \2 G& R+ ~<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
) J' H- j/ b, }; Z<?php } ?>8 q+ q! K. k5 w) O, A* m
</select>
7 d# O( y' N/ X2 Z p</p>( M- L4 N' J: z" O9 u; R- U! T: Y
4 z0 o5 x! ]" t, y1 C
<?php
& d! l# I" d2 ]+ z$ @" @break;4 ^& K6 P. P4 |
case 'textarea':
" C3 I" b2 k5 H* G9 S$valuex = $value['id'];
0 m. w8 F; ^* F) }. m$valuey = stripslashes($valuex);
( L6 t1 H U; F) d( |6 ]5 t$video_code = get_settings($valuey);: g7 N$ m. \* T6 s! r! o* h
?>
4 E: d. S# u3 g! s3 ^
+ _0 _% o4 q' _2 [1 B/ e. J0 J<div class="description"><?php echo $value['name']; ?></div>
$ n9 _6 a1 p1 _# y+ [6 m<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
) a9 p" m* o9 N+ u$ ^0 G! p. g% y; Q
/ i5 A2 ?* _% J# G9 f# ~0 kelse { echo $value['std']; } ?></textarea></p>
6 ~0 K* e. c/ |2 o$ u# n9 R" q, z4 ^: x% p2 l8 j7 c
<?php- l8 W$ Z# c) G& z1 O/ d; t
break;9 b& ~5 W- c5 G, v2 l" }
case 'close':
. V4 V1 w3 V t# U- w r3 a: N& ]?>7 p& V+ ^; ?8 F2 D ~
$ ?3 o5 d0 O4 y; J<div class="clearfix"></div>* M/ J: E+ n; C: A
</div><!-- OPTION SAVE END -->
: l6 H/ c4 u+ |) p, [4 j7 H3 v2 t4 w3 }; k
<div class="clearfix"></div>
* }: u! P& G: [# O</div><!-- GET OPTION END -->. X& n5 I6 e( s$ W/ J
3 q* ^7 y8 ]+ v" R4 Z, z, T
<?php! s+ Z0 {; l8 s
break;; U+ O# Q C2 {9 K: j& V
default;$ t" n0 U, p g# F
?>
# @2 t/ H8 s% S# [* G1 j4 F8 B0 s) K1 a; A! I& o
& r, k: \* ^5 S
<?php
" x: X- o# n3 S- x7 l& Gbreak; } ?> J) N, b( y' q' y& ?; x
* W0 Z r! l: V5 |5 p* t% x<?php } ?>
$ q, E1 C8 |7 p; `5 S4 U0 q8 ?% ]
' D( d2 E! @, h9 r& @- h<p class="save-p">
/ x/ Z6 d+ I4 E$ c1 h/ z<input name="save" type="submit" class="sbutton" value="Save Options" />
6 @6 r' m7 u$ j9 @' N<input type="hidden" name="action" value="save" />8 g- V A6 K. c8 Q" z& O
</p>
9 y0 G1 ^; _- X# e</form>
9 p: z3 ~* \! T: m& N' `) W/ Q8 _1 q1 O* g3 A
<form method="post">
( o: v& d, Y( Q+ Z, U<p class="save-p">" m6 d' ]6 Y F! T7 ~. n0 N
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
0 e+ Y* B/ H$ P, ?; U<input type="hidden" name="action" value="reset" />
4 l1 ~& F7 Q2 }# R</p>
. ~/ _, P( m$ u4 s z6 q. t</form>
9 j1 @# x* |; ~7 J5 O6 K1 r3 b Z2 [5 c. k- S1 K; H+ [; ^
</div><!-- ADMIN OPTIONS END -->
8 D1 @6 Q% S- p; }, s( w( J
9 ?. k* B4 s! D6 h<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
1 w: c* ?3 V! Y: d
" W( o: M) X/ T) tfunction mytheme_admin_register() {7 V) o/ ~. D7 T a$ q
global $themename, $shortname, $options;2 @% b4 X; Q& f9 Z- {7 g0 ~6 ?
if ( $_GET['page'] == basename(__FILE__) ) {$ r; W" h, h) J; W! q4 H- {5 w
if ( 'save' == $_REQUEST['action'] ) {
0 @( ~1 Y8 n7 E" P& aforeach ($options as $value) {2 r+ ^) Z0 h' u# w/ T q% g6 E
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
$ D! G; Z2 P' ~+ A) x% y" eforeach ($options as $value) {8 t+ h; I) j! }; ]; ~
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
4 Q7 P+ E1 l9 m8 sheader("Location: themes.php?page=functions.php&saved=true");( |( ]: W3 X2 b* u9 J
die;4 Z6 l8 C* S5 H8 A/ X
} else if( 'reset' == $_REQUEST['action'] ) {' D$ ]+ |/ f* Y: w! q* r
foreach ($options as $value) {
9 Z. u" L" U. }& _delete_option( $value['id'] ); }
- f; y: a2 F) O* `' r8 `. ^header("Location: themes.php?page=functions.php&reset=true");& Y# S* C" q! n u$ ?/ t
die;
6 U1 \6 s# J* Z4 K}
6 i) \! [# d% D+ ]# ]}$ e6 Y) S* P) O) o. O" W
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
6 W/ `& w$ U. u/ W' o5 D7 d}
2 G# V) k! V+ |. P
3 c& }0 _% h9 d J- F4 W+ Qfunction mytheme_admin_head() { ?>
/ ?- ~) B9 Y, {9 l<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
6 t& ?! Q; b% V) V6 |* M+ \<?php }
( W: r( `' ^' C9 j d% \ |
|