|
|

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