|
|

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