|
|

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