|
|

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