|
|

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