|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
* G, P& ~5 S6 u4 r3 i// Theme Option
- Z% p$ X0 |/ |4 O7 Y////////////////////////////////////////////////////////////////////////////////; P9 N; @2 F8 Q( Z5 N1 _ t1 R
6 D2 \) k |' x9 w3 E" P8 k
$themename = "Zenx";0 P2 Z3 a: [8 |7 D4 ^) x
$shortname = str_replace(' ', '_', strtolower($themename));
1 g' d- I0 q2 v4 m( `
. S: e' O! z2 l9 m2 h. o& Ifunction get_theme_option($option)
2 k1 Q, s, l1 `9 g) t{
& F) J: h5 @1 @6 K global $shortname;
^2 o% |9 t8 T$ o6 s8 P return stripslashes(get_option($shortname . '_' . $option));) f7 H* a4 K t
}
4 I& @0 P7 k% U& H
4 {1 s9 P' Q& b* l3 C# ^0 ifunction get_theme_settings($option)
4 p9 p3 ]" I5 H$ H: E{
7 ^2 F- h$ g" y2 f return stripslashes(get_option($option));/ p! P: P7 w* E1 b0 K5 j
}
; R! r7 g, K# r2 N$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");7 i8 |+ b; G% E5 B: M! \3 E
$wp_getcat = array();, X% G a1 C# ~% T: [
foreach ($wp_dropdown_rd_admin as $category_list) {
. u r! B. T7 J+ b u, ~$wp_getcat[$category_list->term_id] = $category_list->name;
, r7 `+ X0 X6 d) a! c( K, {+ m}+ X) ?4 \; Y- |2 n" j" [
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
* Q; K9 e. {& K$ a/ d$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");1 l6 V' |: \: r' U
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
5 J2 h( ~# a' i2 G( P0 ^4 I3 @+ Y" F8 }" e- h( U
$options = array (- i" n* K7 H. p* b
" o7 J Q; b/ n. @) C& k5 w7 d& \% b3 j$ j+ f3 ?8 o/ f) H/ U) P- A+ O
array( "name" => "Blog Header Settings",9 p J' m& R, g6 l. m
"type" => "heading",
& @& Q( Q- s! W+ D; u ),
6 d' |, Y: [+ r% x; D# |* ^
. m9 n( \! z+ Y+ y) F: b1 K0 N array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 { c* C5 {9 D7 q' B
"id" => $shortname."_header_logo_activate",$ r! Y. K8 l- \, i+ D# V0 X3 V1 H* v
"type" => "select",0 d& c! l3 Z8 L( h$ n8 q7 t
"std" => "No",
% a8 I0 L% t! @3 y1 [- X1 w "options" => array("No", "Yes")),
f# ^$ i+ W, E2 d% n* z) Q
1 m/ `2 e/ {( O* l: e" F( \ {+ U array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",/ L( f; y( }, E0 M5 ~* r5 ]! h+ A
"id" => $shortname."_logo_url",
5 @2 g2 M; p: n# [ "type" => "text",5 t$ x. Z" b9 x: O3 C6 e; @% O
"box" => "social",
1 @3 M5 ]5 c# V9 C. j( d "std" => "",+ Y$ C4 q3 b6 s+ _$ T: l
),
" G! D9 Q; m1 R8 t$ h7 \, b. I + X- W S) H( A7 ^# {! z
array( "name" => "Insert Header Banner HTML Code (Header)0 Y6 f k* `/ G
<br /><em>*Recommended Size 468 x 60</em>
9 P5 b) a6 ^$ I J. P* j <br /><em>*leave blank if not use</em>",4 _+ o; f( v0 s0 B; w
"id" => $shortname."_header_banner",5 T( d. o( S, h) |
"type" => "textarea",
& ? ]2 q3 u; c& n* t1 j "std" => "",
. |1 b* c/ v* ^, I! B$ K ),
, f$ v1 Q4 ~" U! [. F9 C/ v# x5 H2 `- u' U+ z
array( "name" => "</div></div>",
: G' Z/ f F2 i' b1 D! C4 Y$ C8 G* ^ "type" => "close",- B: S0 y# n: N, }$ W- a
),$ Z7 n8 `; ~0 h. y
( t z2 w: p5 a$ b, l
' ^* n, |& U% w2 r
array( "name" => "Header Navigation Settings",
+ ]5 }0 p, e0 k2 G; ^/ M% B "type" => "heading",5 ~; d: i3 z' D
),4 ~1 c0 A8 r: |/ Y7 H: V, l# O: O7 ~
# N7 D: j; F; l, b* K' q% c array( "name" => "Insert Page ID To Exclude On Header Navigation<br />6 a' ~0 B/ L: r
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
_3 { O# Q5 ?4 m. U0 L: l3 W <em>*Enter the page post ID number only</em><br />
4 ]$ m4 C6 m: g$ \: y <em>*separate by comma</em><br />
6 K" R. u& g! ^5 E" J <em>*Exclude pages which you don't want to show on the header navigation</em>"," m' ?: E: D" y z, m- o% G G
"id" => $shortname."_header_page_navigation",
8 J( d9 i! e- l6 z "type" => "text",
1 l" c9 v2 k. `5 c/ j0 V "std" => "",0 l5 A& [1 F; i; h; a$ ]
),- ]/ d$ f) ?# M0 k/ O9 \+ H, e
- |' k5 w# L1 A, V array( "name" => "</div></div>",, I* X6 v6 L4 E; Y% s( A* l' [" ]0 ]
"type" => "close",3 C" o6 U3 U0 j! f+ u6 Q2 U
),* |: e8 R4 a8 e% Y5 K) v9 g
5 h1 |7 i& |6 M8 G7 P+ e0 O0 ]4 T" `, P7 a& n r7 F
array( "name" => "Post Auto Thumbnails Settings",2 j8 ?1 s( R5 \( X
"type" => "heading",$ V1 d% H1 _/ L! c5 z
)," i) r7 a; K# p! J2 E6 d
* ?5 b4 g9 U( ]& \ array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. d7 |/ r$ [$ ?5 W "id" => $shortname."_timthumb_activate",9 B6 f' t- H9 y$ K
"type" => "select",
& H* Z# c( X2 ? "std" => "No",5 n7 V' b f3 C$ T8 }: v
"options" => array("No", "Yes")),
3 \' [7 |) c) c% {# f$ I
2 ?1 i4 T! g' H0 M" x array( "name" => "If Timthumb is enabled, Please choose its cropping method",
* r9 T4 S) E( N0 B: K5 x6 D3 [ "id" => $shortname."_timthumb_cropping",1 I S7 D$ f; a% p0 O5 Q
"type" => "select",0 n$ a3 y- k7 R! h/ m5 C3 r: G
"std" => "",
% ~4 L7 Y7 ~, A9 ~. H" u* @ "options" => $crop_position),
# t" k k. _7 }. x1 a. {, \& k. Y) ?6 Y0 u
array( "name" => "Insert Width Of Thumbnail Image<br />
. E9 B- M e7 T$ X( g <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /> @& s$ ]7 s0 R. |8 x6 U2 @
<em>*Leave Blank To Use Default: 250</em><br />",
7 W. E; C0 Q9 @; {, E "id" => $shortname."_thumb_width",
/ U! w2 U. ~, G. M "type" => "text", F+ ?9 a" x$ B" ^8 h
"std" => "",
; n2 p+ I6 b: b ),
4 N/ J8 V* A- Q2 \3 P, v- T" X: |
array( "name" => "Insert Height Of Thumbnail Image<br />- T- D9 ^- B5 a6 h2 x0 ^! w m- n g( O
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
8 k8 V$ ^/ @5 y! e: F# U; O <em>*Leave Blank To Use Default: 200</em><br />",, n8 |" t) W7 N
"id" => $shortname."_thumb_height",
" _2 k0 M8 l7 P* ~& [ "type" => "text",6 |# p3 i$ z+ s9 K" X+ f6 H
"std" => "",
$ S& N* d/ W* v! B" } ),3 {7 s) R* G& a( @ b$ M6 J8 u
& {3 H% D2 J% y, k P; g" s
array( "name" => "</div></div>",
& ~% S4 E- ^+ z, U. H "type" => "close",) ^& X/ s$ J/ e1 U! e
),
; D! _- A( K& Z4 p2 e
1 H* ?2 p0 n, z" ]$ M3 m/ I' [3 O0 i array( "name" => "Featured Content Slider Settings",; B6 y* i$ D4 ?# g* T
"type" => "heading",
2 U* g; G4 F" M" a ),
. k" c( Z6 v; q3 r. A6 _% n
' c' v# s5 h$ Z6 M8 N array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ ~# w% E- ~! ^4 p. g! d6 i
"id" => $shortname."_featured_activate",
, _& a, M, m8 u! X "type" => "select",5 ?( o2 Y3 A7 E
"std" => "No",
% ~" A% @* J9 ?+ l "options" => array("No", "Yes")),
1 k% V" \! {( {! h: F6 S* K. N8 w# ?
. O, n T; n4 @7 f' B# U
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
: G; B& b: R4 y. n( O& A( v' A "id" => $shortname."_featured_category",3 n0 D: d# V5 K* J+ P/ y: W6 |
"type" => "select",4 R* y- H0 A# O; A0 K; O# G
"std" => "Choose a category:",
$ a }7 w1 f, ` "options" => $wp_getcat),1 F* P ^" w5 Q- \2 c
1 G5 i! Z: y+ s2 W$ ?3 T' b' [5 Q array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",: B9 F1 P! `" g# S
"id" => $shortname."_featured_number",
% h& T9 h; N2 w" Q" ] "type" => "select",3 B) O+ b, S( C9 I
"std" => "Number of post:",
9 R+ V& B% k% U "options" => $number_entries),: Q* e8 }1 @& B N8 U4 _% Q/ k
! Q9 d$ m3 Q) a& U( m2 ~+ u
array( "name" => "</div></div>",
5 `) X) q! E6 | "type" => "close",0 M/ i; b2 y' U9 i' h6 r
),
: S* w0 X0 i# Y' L + v# j" H( _; I7 M$ W: f
array( "name" => "Featured Category Settings",
/ Q$ r. }$ Y4 L; ~% m0 }' \ "type" => "heading",
: b& [' ?2 ?$ f; U/ S3 U7 M; H ),
, \5 M8 C( ]% l$ l7 e' m. L8 D2 j5 D) N# W4 l! E" s i
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% x( v6 g4 T9 z# l
"id" => $shortname."_featured_category_activate",
* r4 \3 X' C. {3 b; m "type" => "select",
# k9 A* O. t- O h7 v "std" => "No",
8 f$ |8 } n2 Z5 y% b; G! w "options" => array("No", "Yes")),
, q( B1 A* ^9 Z6 [: W( Y5 T 7 F/ S# p/ t" k: m- x. U
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",1 m2 a( m, L+ e2 w8 _" h8 Y, G
"id" => $shortname."_featured_category_id1",: l; V2 e9 T' V4 e: I5 l' S- o
"type" => "select",2 Q4 |" P# @& \7 h5 F( \: ~; O
"std" => "Choose a category:",- h6 q# D3 L. \' K* d
"options" => $wp_getcat),/ q+ x: F' \( I/ c, O; ?. x& g/ v
% s: }* k6 z: y4 t) i# E. G array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",* I u9 a p+ [& s/ p9 ?7 h$ S
"id" => $shortname."_featured_number1",' b* w6 s) I5 }+ ^
"type" => "select",/ a6 o6 b$ Y2 r2 Z6 r
"std" => "Number of post:",9 Y* t& U7 H- B- M( D9 W
"options" => $number_entries),
% b7 x1 k0 n% B/ w A
* G" r# e+ ], h4 ? array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
# H \. y7 O9 w0 m "id" => $shortname."_featured_category_id2",' m, a. u$ ]: ]& Z! f8 q3 b
"type" => "select",) X) f4 i6 `) y% C: t1 e3 `+ t! }; s
"std" => "Choose a category:",
! G6 M5 B; o- f3 f+ M% x- j "options" => $wp_getcat),: z. r9 y- G, ~7 K O* _, a: Q# W
1 a1 T( `, U2 r, v4 w* J array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
" C5 M8 Q" a# P1 J5 x: w) c9 _- T "id" => $shortname."_featured_number2",
v! V7 T% _0 z' P0 @# n "type" => "select",
+ w, m" w: ]+ S8 ]& C2 M "std" => "Number of post:",7 l( W$ w m& Y+ N1 \8 C
"options" => $number_entries),5 u3 J6 s- i3 n0 J! v( K% p0 [5 _
# ~6 ~: r0 N* p8 ^' S' R. y
* D/ c" S2 ?6 ~# _# e array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",# j6 d$ j8 c( `) u1 r
"id" => $shortname."_featured_category_id3",1 d1 z; i" Q8 R1 W0 P/ r0 d* Z
"type" => "select",
# u- z. j- c3 Y- f& S' M% ] M "std" => "Choose a category:",& ]: ], p% n: I1 u0 l0 {
"options" => $wp_getcat),
2 q$ G) y6 ~# @
* Q5 s4 [* K! O( 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 s! W& `5 H5 b' W/ [# C
"id" => $shortname."_featured_number3",# G" C+ R' x7 _9 V% x
"type" => "select",% q; ]+ N( y* B) h
"std" => "Number of post:",
$ U, `7 a/ ]" ^: P) k. } "options" => $number_entries),
; N( d! I- M- w6 E( X% f: {/ B3 @8 c! v: l" u8 H; q) E- Y1 {
0 s: S, G* C0 o+ [4 s; L% w- F+ z
array( "name" => "</div></div>",. D0 ^- z/ N6 p$ `2 P( R1 S- [
"type" => "close",
& W: t# S% `# j9 I; R6 k' a4 x ),
! c o/ [ o, k: w0 N1 Z: C$ U6 ~7 I% X- T) d
4 N- a3 |- U2 _& G& l array( "name" => "Google Adsense & Analytics Settings"," G5 P9 e0 D5 a" d* e
"type" => "heading",% {, Q* z. N$ l' C7 Z
),$ b: ~6 t8 p! w9 o% ` E
# t9 G* U9 h7 ?+ @* h array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",$ P/ F8 q0 B. o; [; s
"id" => $shortname."_adsense_loop_activate",9 v( J$ i8 x/ e$ ~7 G
"type" => "select",
1 t! v k5 _" ]) X: }2 \" G ` "std" => "Disable",( a. L+ Z" n, l/ U" X
"options" => array("Disable", "Enable")),
# g }% s Y9 \* B. X( O6 W* z% k/ @. c4 D# Q
array( "name" => "Insert Google Adsense Code For Loops Here<br />
m; [1 i$ B% q5 g3 G/ ~$ b <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",9 H; p+ ~ e" | r
"id" => $shortname."_adsense_loop",
8 T; M, }$ R7 T$ l! F2 H6 t) W3 I6 y "type" => "textarea",0 o* l4 k& g4 c9 B& D% l, Q
"std" => "",
5 s, ^7 k& I* a! N ),
% C1 x4 ]! G! m" A/ w3 _
& @2 p T3 u3 G; C5 i# J array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
7 G) o3 e6 t0 d& A% W; c "id" => $shortname."_adsense_single_activate",6 |" K+ j, K4 Y- r2 g! n$ l
"type" => "select",
$ O# D$ }1 Z' F* z( N( n; U$ N "std" => "Disable",3 c4 l7 a7 N# o& J. M* H
"options" => array("Disable", "Enable")),* l+ U- Z+ p5 b
) z( o- d/ D( p1 D- Y. y9 ] array( "name" => "Insert Google Adsense Code For Single Page Here<br />
( C- l, H0 |1 [- D( u3 c( n <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
3 t' W9 I0 F* R% H- Q- T "id" => $shortname."_adsense_single",* ^% Q4 v6 S- K: F: x; r9 K
"type" => "textarea",: I$ e. R. Y9 `3 b, @9 B
"std" => "",, x' `; R% T3 V& z8 n, G2 i
),
! @5 \3 r0 W" k' Z, C1 N' D6 ^! T
+ t8 f Y+ ?- u0 u% a( V( I) X+ J p- ]$ Q. {6 r
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",$ d8 P1 Y) D o
"id" => $shortname."_google_analytics",: Q( L9 J6 r I& x0 A/ M
"type" => "textarea",% r) e0 }6 ?: q
"std" => "",: R5 I4 ?; p0 D. q. Y `: x
),
1 v2 M! F, s$ Y; U3 i# `6 }/ G( l/ a3 Q' t5 s. e1 B- m A1 H
array( "name" => "</div></div>",# v4 ]8 R% S! t6 t2 [/ z0 G# D
"type" => "close"," k! M% @5 z* R9 Z( W5 s M
),
# N1 R7 S% f4 M: g
5 [/ ?& R. W4 g8 S$ h ! B" f. x4 B& M: _2 }
array( "name" => "AddThis Social Bookmarking Settings",
9 U$ I! q7 k+ |- _8 v "type" => "heading",/ Z, G2 P0 X. Z% X. {
),
; Q; o: M: [3 e& f$ ?
3 o1 v: M. |: O: A& h& j array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
) T+ F' W: \- T, Y. b- f <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
, ]3 f2 P5 J7 e. o" |3 _ "id" => $shortname."_addthis",0 H9 A& x5 A8 Y: a) W
"type" => "text",
( _; {" \; e7 w "box" => "social",, [& O0 ?; h8 K* c& F3 \- a: D4 L
"std" => "", s8 l) _7 x8 ^/ F
),
* V6 o5 P" ~) V6 x' o0 Y
6 r2 U6 S' j+ `* l( F array( "name" => "</div></div>",
4 j4 k5 G3 H7 g5 e; F( Y9 i& f% E# g "type" => "close",
7 }% P0 i$ ~$ h: A' R! z( q ),- d, E: _" M( A% V
: @( r& _3 ?6 H0 u
. P& p' U; k# J$ k
2 `3 i2 W8 f) r2 ]9 q" r array( "name" => "YouTube Video Settings",
' Y& u7 f, q2 \( H$ S: |3 X3 C "type" => "heading",; K/ F+ M2 A7 n& |+ L5 c# T x
),
$ b* }1 _. m* u9 c- @
9 V- x# |* q I7 M. d array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 g4 t# Y$ ~2 T
"id" => $shortname."_emvideo_activate",5 r# I# H" @2 @6 a: t1 G4 Z7 _( L& h
"type" => "select", O! b: u' f3 y v0 ^( R0 z; h& B% ~
"std" => "No",/ I0 w, e/ W# ?) S0 U: y- W5 d( m
"options" => array("No", "Yes")),' O( Q4 u Z2 @1 L( e
+ C% u g8 u3 q5 ~
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>",& x0 t- g3 s4 A
"id" => $shortname."_emvideo",
, F( Z- i* \" y! Z# _ "std" => "",
5 E; V6 P5 L5 P) }3 c- u r "type" => "text"),
`# ^2 r9 o4 @0 s( I0 K+ _: e2 c- X2 f7 G$ }; u% U& W
array( "name" => "</div></div>",
8 }. [0 P( K; ]1 r% v: H7 ~3 G4 L "type" => "close",4 |3 c4 X/ E7 q# z$ G0 P
),
. e5 u U+ p. T4 `& u& z4 c x
; B- n& ?1 k- l' }3 ~ array( "name" => "Twitter Settings",0 L$ d) `+ x% x$ d
"type" => "heading",
& W# y& K) `( l ),- H o/ W9 [; E2 x
8 r! @7 w% a& J( s
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! ?; i+ ?# N: e; z "id" => $shortname."_twitter_activate",: r7 Q8 y, P/ b' d& v8 m
"type" => "select",
5 V# h' ?' R) ]& c6 G# Z& h "std" => "No",
, Q) \' K6 q2 g) E/ Y6 f "options" => array("No", "Yes")),
2 D5 t9 ^* [( L1 t" P3 z- ^* V6 T6 a; p _0 `0 U
array( "name" => "Insert Your Twitter ID here h" a4 g* d* J. `9 l
<br /><em>*leave blank if not necessary</em>
( F' u6 [" M) h! \! E% r3 E <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
: b$ @1 d; X4 T0 C8 p8 q "id" => $shortname."_twitter",
# {, W/ W9 j4 O; K4 C "type" => "text"," x3 T: ^% C# \) }2 u ~ \7 I
"box" => "social",
5 y: J- e4 Y, n7 Q6 e8 }$ G: ? "std" => ""," e- l" L0 V2 Y3 }5 z
),: A5 Z- e4 A% B( A2 A( L, B
- ]0 T7 J3 G) [+ ^, | array( "name" => "Enter Twitter Feed Count here
6 y( y+ X! J* U, s <br /><em>*leave blank if not necessary</em> U, t4 w/ K# j
<br /><em>*Enter How Many Twitter Feed To Display</em>",4 c V$ ^2 `. i+ l' y% K- D
"id" => $shortname."_twitter_count",
" Z: z k- y6 _& W2 d+ | g "type" => "text",# ]0 A8 _9 M1 p0 k/ w
"box" => "social",2 M6 I) M' q, P( C f
"std" => "",
' g! p: a* |6 y ),- m" _( O& y5 U M7 g
# U! C* |8 @* N5 y Z& S array( "name" => "</div></div>",
. ]8 {* K! M5 s: T8 j$ W" Z9 u; n5 W# f "type" => "close",( x* a9 C5 C8 y1 [1 H
), a# d1 C; ^$ ~: d1 {
9 m. _* M& u9 c' z2 @5 h% r, T% P1 z0 M; n: S4 D. _) I
array( "name" => "125 x 125 Banners Advertisement Settings",
' A1 O6 E. O K" j: |+ n p "type" => "heading",, ^' }- N0 X7 G/ ^& o5 a
), e7 D/ K; \, b4 G" ^" X+ t
: `! m! X) a5 U( Z" M9 v8 p: v array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! G9 ~; l% I5 W7 o
"id" => $shortname."_sponsor_activate",
9 @/ m5 _1 p) ~ "type" => "select",
7 t5 C1 S8 r4 |/ x "std" => "No",
$ A- r- {7 _0 W, Z/ q "options" => array("No", "Yes")),8 p N; Q0 q8 R! D ]
7 @ o9 n3 A0 y w
' Z' R# P6 f4 ^2 z3 S7 e) M array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
3 h+ @ |; V1 L7 Q$ n/ A "id" => $shortname."_sponsor_banner_one",& J9 [6 a) A8 [5 J4 B, |
"type" => "textarea",
Y, _3 d! x- \( N8 @ "std" => "",# K" H- H- w* K- ?0 l" n- u0 _3 V
),
: P- c5 W2 K P$ U$ A; c: e- w8 d0 u6 `3 Z
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
( j3 e! L6 z' `1 S8 L8 R "id" => $shortname."_sponsor_banner_two",9 l9 y) A# y2 F7 _/ _
"type" => "textarea",6 Z- {9 i( c7 R% F# G! s
"std" => "",! Z+ l9 I+ ?3 z$ g
),# O# l" s& b3 s2 W
+ c3 ?: w% ?& K; s* J6 q5 r# C array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
0 U$ V& g% `/ {3 Z) h "id" => $shortname."_sponsor_banner_three",
% M. s/ a7 ]3 `! N9 @6 Q& n "type" => "textarea",# |% G6 X6 d4 Q! Q
"std" => "",6 X; y; l4 H- W
),
! o6 h7 d6 t U! e% {! V
6 S5 M+ t, T+ d) ^6 D2 e- c, A array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",5 \, V$ F3 T$ ~) a1 Y, p* v6 ]
"id" => $shortname."_sponsor_banner_four",4 K3 a4 y" m0 v/ B
"type" => "textarea",/ ]6 H5 m b6 H/ u9 X0 M8 u
"std" => "",: N3 b/ H8 s! v d" w
),
) o0 x; N# l% Z* t0 I& d8 |
" J2 r* J; H" m array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
% |7 B8 `6 Z" x8 }" S9 z, ?* p. ^ "id" => $shortname."_sponsor_banner_five",
# `& p0 y5 Q1 X2 f$ j0 @ "type" => "textarea",
3 C. `2 w" ]7 Y# {) M$ i& v9 p "std" => "",
* D" Y. ]# ?" E- P0 A ),
) e+ d* a4 n( S8 V' B% K3 _$ I8 j5 L* e0 W1 h# r8 p
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
% g3 R4 W9 x+ |6 V. M "id" => $shortname."_sponsor_banner_six",9 X' y* a/ |3 S! D" J
"type" => "textarea",- r1 [9 L( r" M; G7 z+ c! u) u. q
"std" => "",. d1 j7 E9 N. L
),
1 H( l7 ?( o9 [- ?
/ N+ Z- @, r+ S" M, t% o, D array( "name" => "</div></div>",
' ~7 J- E6 ^4 [ "type" => "close",
/ v" ^4 @5 q2 }9 b3 ~" a ),- m0 B. N- Y" k4 u# k
7 i) V/ g: b! w ~& h# f3 o* X
# \. U1 d/ N4 u- X' ]
# @" p: J) U' o o);# n' a- \ {" u7 L
4 T) ~. a( b; W6 V4 @/ Vfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
' u# |- F* ~" c: B! P$ `
5 J' G$ U% N) l7 ]% |echo "<div id=\"admin-options\"> ";# A6 F0 I8 b3 f9 }3 k( p% n
4 @( ?4 {) Q. [2 yglobal $themename, $shortname, $options;
* x0 d- u7 @3 a/ iif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
! b# u1 w: j' I* L1 Q* \if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
, s! a+ G1 S+ ]: l& v$ e$ B?>
! @7 E: T7 L9 n; P7 P+ n6 [: Y, ?
1 J* |8 J3 l$ j. Y# g% m9 a: R<h4><?php echo "$themename"; ?> Theme Options</h4>
/ u% Q. v) P( p9 A& _2 I: M% T* E9 C# D7 W i/ L5 _
<div class="annouce">' ~6 n8 Y( p2 M4 H
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>' \ v4 X6 n3 O$ [# j9 N: P4 z
<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>
* o; k1 F2 d1 F& _* ]</div>6 x2 M, ~& O9 i |) X1 n/ M
3 h x; p/ P% y( V' E- a9 K# ]1 ?
<form action="" method="post">
& y! Y* z+ Y9 u. {+ \
+ F9 W& d* t$ [. i1 a<?php foreach ($options as $value) { ?>
! B+ r& n E7 h7 ~ Q5 N* J" g3 y
<?php switch ( $value['type'] ) { case 'heading': ?>
2 j! ?* W+ _& X' ^( s
. X3 s3 [! o& R9 u4 A<div class="get-option">1 B5 h" C. m/ A- \! `, l
& s, @9 l9 n4 ^! g" D<h2><?php echo $value['name']; ?></h2>
0 |4 M2 h% f' g4 R O
0 J9 d5 ?$ `* u( p# e# z% f; R<div class="option-save">
# |0 x. o, B/ X I- `, ~7 r1 g4 V+ G. U% y
<?php
: I$ j- T, `0 m# obreak;1 X& e" {; i* s% \) l+ a( U
case 'text':* U2 M% k9 Y/ u5 g
?>
! f+ S5 F! @) V; t1 f) S
5 o2 Y0 e3 ~0 r! k+ r8 S<div class="description"><?php echo $value['name']; ?></div>
6 p) u- H- i, Q' [% e P/ c5 B) |8 m<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (" |) [& g ]$ \8 x6 e5 t4 J5 ]
" U( l: _* ]2 o( t$ C( V" l9 dget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>$ e& c7 W$ b5 ^; [% m
; _; J, `9 p+ `4 N4 \( C<?php; I& x8 b1 I* {! K4 O
break;
3 Z- Z/ r; W2 E! [case 'select':: T$ _) G' b4 o" \8 G6 Y
?>
. n0 @6 E! e `7 x* E% y- E: t3 R( m8 g. J# |6 @& a
<div class="description"><?php echo $value['name']; ?></div>/ d0 n8 Q) }2 l% q5 O& T" v9 `
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">4 n. n$ b& m0 c* V% L5 s' y) ^: _
<?php foreach ($value['options'] as $option) { ?>
# G3 L. m7 T1 g<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>5 q+ p( f7 b/ |. h. [$ S
<?php } ?>% V. j' O" e0 N
</select>- } h g. } g1 f( k
</p>: n% v. t3 U. i s
/ e" o/ Q' N4 }8 s9 m3 H
<?php6 h% J7 L2 o' d" D4 e) V5 E
break;
( Z. v: T) ]4 {+ N' [+ F t+ hcase 'textarea':" `; _! J6 m; {& H1 Y% j8 r
$valuex = $value['id'];& L' X8 o! r# @0 X5 g
$valuey = stripslashes($valuex);; R \! X. W4 W. C p2 y2 N5 l
$video_code = get_settings($valuey);. D7 q8 Q6 K |1 P7 G1 i) @/ }
?>
]7 N: P/ N, a' w& B# Q8 G7 k: w
( @8 Y) b$ B# Q/ h4 f& k<div class="description"><?php echo $value['name']; ?></div>- [% p, e# _, i
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
( @( H7 i" J7 a# z0 Y! x) n% }6 [" @- }( ~
else { echo $value['std']; } ?></textarea></p>7 s; L9 _, ]+ j; k
, H# H; o" h! i8 ^" Q
<?php
$ P9 P! i( e6 R& p: b/ Abreak;
; H6 w- ~0 I( Xcase 'close':
. n. P) K* z4 g/ n& ]?>
2 c( n0 X+ a9 `5 F- l3 d: {
( A+ S& I M$ J q<div class="clearfix"></div>8 [5 n1 F( x; Q% o" ^
</div><!-- OPTION SAVE END -->7 J/ A# l- d1 P# c% k$ e9 U: Q! j! }
& n' b' t7 B% Z
<div class="clearfix"></div>
h) g! A. A4 ~; ^* b, I& T</div><!-- GET OPTION END -->
5 d2 ^/ Y, U6 \8 L5 ?% C% P5 a. @- [8 C3 ~& T6 n, Q5 a7 F" \# W
<?php
- P% E: t b! Y7 a4 u. k) y2 r' \0 rbreak;
# H; P. c% A- q' F; k' X" vdefault;
c; J! o9 A2 Y$ U?># Z$ S4 D6 L# W* O: D
0 z \4 P' G: U( M, P+ [
' d' f3 y' H; X; D, B4 S<?php
% m5 c2 R: a7 c! z. h2 ]break; } ?>3 \6 Z0 e) R' ^* r
* q4 j- ~, T9 R( N9 W" q% ?
<?php } ?>2 S: l# ]5 g+ `" T
6 ]8 q# h+ d; Z' {; O4 g2 a
<p class="save-p">/ F5 w2 x" ]1 G$ ?5 i5 E$ E
<input name="save" type="submit" class="sbutton" value="Save Options" />8 I% ^* {2 {7 a. N2 T3 g- c
<input type="hidden" name="action" value="save" />: ~" O9 M. W9 }" C- n ]8 [6 ~
</p>% O5 M" V* o- w1 Q) X4 }; O9 u: c5 {
</form>$ X3 M0 d( o, R' k
( c! q, ]% p- G5 o& B8 t<form method="post">5 l! c+ B$ I2 A
<p class="save-p">
' c1 h# U! X4 `5 r4 z# i<input name="reset" type="submit" class="sbutton" value="Reset Options" />
& \' C9 o, `) l& h<input type="hidden" name="action" value="reset" />
' i( z. V( H1 J, @</p>
" {- y' ^" @! V</form>
3 ]3 v& X# V6 |- G8 B
0 c9 e; s& r. Q$ C+ w</div><!-- ADMIN OPTIONS END -->
2 c7 G0 p' Q/ A! b) P
+ O# u! g E4 G4 m6 { e$ y& I& j<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }$ k( l4 h( }. w/ O6 x9 O4 t
+ R% e4 v9 n' L! y# l; B1 C
function mytheme_admin_register() {
* E& V/ p R Y2 u% C: w. ]& Aglobal $themename, $shortname, $options;/ Y' B5 Z9 q6 f( u. d
if ( $_GET['page'] == basename(__FILE__) ) {* s9 ^3 B3 U4 q
if ( 'save' == $_REQUEST['action'] ) {
2 m! A2 S8 Z; Q' h% g2 Tforeach ($options as $value) {
5 S" R* B5 B4 E, ^% v nupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
; f1 w& c! |; i) P X% ?$ r6 Mforeach ($options as $value) {
8 V L8 @4 ]) xif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }0 [* E$ p. t' l! Z: R9 G
header("Location: themes.php?page=functions.php&saved=true");
- {& \# Q' }7 I- ~" fdie;7 \2 V. ^: g+ _" G5 \
} else if( 'reset' == $_REQUEST['action'] ) {
. Q; U6 y% b) R E- sforeach ($options as $value) {
: ], u" f9 y! F, z+ Sdelete_option( $value['id'] ); }
, r3 Z9 F% }1 w0 A3 E0 Hheader("Location: themes.php?page=functions.php&reset=true");
8 K- `6 j# T2 O& t4 S4 q; Odie;- Y1 D! [$ F/ `6 U# L
}. w$ l! |3 k; G9 N' ^" e& i
}
. p2 n$ y2 J# q( t" i% ?add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
9 `; N( C$ ?/ i$ |}
3 W- ^8 v: V7 r. t0 `, X
+ M) b) g& e! c" R6 f& x {, n2 Jfunction mytheme_admin_head() { ?>
& T& d7 S5 M; `# g<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
" ]3 \1 J* L, x$ c<?php }
3 \: W1 E7 W5 N6 H0 L# | |
|