|
|

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