|
|

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