|
|

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