|
|

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