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