|
|

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