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