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